ffmpeg/libavformat
Andreas Rheinhardt af8d5aab74 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-03 14:13:50 +02:00
..
2016-07-03 04:37:48 +02:00
2017-03-31 18:19:41 +02:00
2017-03-29 14:49:29 +02:00
2017-02-01 02:57:40 +01:00
2017-01-19 02:40:43 +01:00
2016-10-21 19:41:09 +02:00
2017-02-11 20:20:07 +01:00
2016-05-04 18:16:21 +02:00
2017-03-12 18:24:49 +01:00
2017-03-12 18:24:49 +01:00
2017-02-03 19:01:59 +01:00
2017-03-12 18:24:49 +01:00
2020-07-03 14:13:48 +02:00
2020-07-03 14:13:49 +02:00
2016-05-21 18:49:45 +02:00
2017-06-02 01:14:38 +02:00
2017-03-30 13:26:04 +02:00
2016-11-07 00:51:49 +01:00
2016-07-17 13:10:27 -03:00
2017-03-02 11:39:54 +01:00
2016-11-23 01:16:42 +01:00
2017-01-30 11:00:58 +01:00
2016-07-17 13:10:27 -03:00
2016-05-03 15:45:10 +02:00
2016-10-09 20:09:00 +02:00
2016-08-04 16:25:40 -03:00
2017-04-02 19:49:45 +02:00
2017-05-14 00:21:49 +02:00
2016-11-07 00:51:49 +01:00