FFmpeg/libavformat
Andreas Rheinhardt 4cdd6cac1f avformat/mpegts: Don't leave context in inconsistent state upon error
Up until now, opening a section filter works as follows: A filter is
opened and (on success) attached to the MpegTSContext. Then a buffer for
said filter is allocated and upon success attached to the section
filter; on error, the filter is simply freed without removing it from
the MpegTSContext, leaving the latter in an inconsistent state. This
leads to use-after-frees lateron.

This commit fixes this by allocating the buffer first; the filter is
only opened if the buffer could be successfully allocated.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 1ead176d874acb489827ace3935fc71e1eea7e0e)
2021-02-22 22:00:29 +01:00
..
2021-02-20 14:21:24 +01:00
2021-02-02 14:18:21 +01:00
2019-12-12 19:25:33 +01:00
2020-05-31 00:55:12 +02:00
2020-11-08 00:26:11 +10:00
2019-12-12 19:25:33 +01:00
2020-03-17 22:46:36 +01:00
2021-02-02 14:18:21 +01:00
2021-02-02 14:18:21 +01:00
2019-12-12 19:25:33 +01:00
2019-12-12 19:25:33 +01:00
2021-02-02 14:18:21 +01:00
2020-03-17 16:05:49 +01:00
2021-02-02 14:18:21 +01:00
2019-12-12 19:25:33 +01:00
2020-03-17 16:04:42 +01:00
2021-02-02 14:18:21 +01:00
2021-02-02 14:18:21 +01:00
2020-03-17 16:08:13 +01:00
2020-05-30 18:02:55 +02:00
2020-05-19 20:09:25 +02:00
2021-02-02 14:18:21 +01:00
2020-05-31 00:55:12 +02:00
2019-10-08 13:47:16 +08:00
2020-04-19 02:37:46 +02:00
2019-09-27 12:15:50 +02:00
2021-02-02 14:18:21 +01:00
2020-03-17 22:46:36 +01:00
2021-02-02 14:18:21 +01:00
2020-06-06 00:25:00 +02:00
2020-06-06 00:25:00 +02:00
2020-05-19 20:09:25 +02:00
2020-02-16 12:54:57 +01:00
2021-02-20 14:21:24 +01:00
2020-06-04 10:52:42 +02:00
2020-06-14 22:02:34 +02:00
2019-12-12 19:25:33 +01:00
2020-03-08 19:08:04 +01:00
2020-02-20 14:41:26 +01:00
2020-03-12 18:47:39 +01:00
2021-02-02 14:18:21 +01:00