ffmpeg/libavformat
Andreas Rheinhardt da63a31a10 lavf/webm_chunk: Fix NULL dereference
The earlier version of the webm_chunk muxer had several bugs:

1. If the first packet of an audio stream didn't have a PTS of zero,
then no chunk will be started before a packet is delivered to the
underlying Matroska/WebM muxer, i.e. the AVFormatContext used to write
these packets had a NULL as AVIOContext for output. This is behind the
crash in ticket #5752.

2. If an error happens during writing a packet, the underlyimg
Matroska/WebM muxer context is freed. This leads to a use-after-free
coupled with a double-free in webm_chunk_write_trailer (which supposes
that the underlying AVFormatContext is still valid).

3. Even when no error occurs at all, webm_chunk_write_trailer is still
buggy: After the underlying Matroska/WebM muxer has written its trailer,
ending the chunk implicitly flushes it again which is illegal at this
point.

These bugs have been fixed.

Fixes #5752.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 8c6ee7626bcce7c270360f33b60dc7ef99939fc3)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-02 10:48:42 +02:00
..
2018-04-05 22:04:30 +01:00
2017-03-29 14:49:29 +02:00
2017-02-01 02:57:40 +01:00
2017-10-19 22:07:21 +02:00
2017-09-20 03:31:48 +02:00
2017-10-19 22:07:21 +02:00
2017-09-01 18:52:56 +08:00
2018-04-16 14:12:48 -03:00
2017-02-11 20:20:07 +01:00
2019-03-21 10:42:52 +01:00
2017-10-05 17:10:23 +02:00
2018-04-02 03:26:22 +01:00
2018-04-12 16:04:58 +08:00
2018-04-05 22:04:30 +01:00
2017-04-20 15:39:18 +00:00
2020-07-02 10:15:09 +02:00
2020-07-02 10:43:52 +02:00
2020-07-01 13:33:44 +02:00
2017-12-08 16:01:09 +01:00
2017-03-30 13:26:04 +02:00
2017-06-13 19:49:06 +02:00
2018-02-11 20:03:33 +01:00
2018-02-11 20:03:33 +01:00
2017-04-25 15:39:10 +02:00
2018-02-11 20:03:33 +01:00
2018-03-07 22:26:53 +01:00
2017-01-30 11:00:58 +01:00
2017-09-09 12:07:14 +02:00
2017-12-31 16:14:23 +01:00
2020-07-01 13:33:45 +02:00
2019-11-11 20:18:45 +01:00
2019-11-11 20:18:46 +01:00
2019-11-11 20:18:46 +01:00
2019-11-11 20:18:46 +01:00