aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/formats.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-10 14:20:58 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-22 22:00:29 +0100
commit4cdd6cac1fc14ee5c2b19c059c72486d4fc6ba34 (patch)
treeed1d2fcecf4c0cff047a9a95a5e8f466b85f2982 /libavfilter/formats.c
parentea42edb9336ee0968910250177d27c23b68231e8 (diff)
downloadffmpeg-4cdd6cac1fc14ee5c2b19c059c72486d4fc6ba34.tar.gz
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)
Diffstat (limited to 'libavfilter/formats.c')
0 files changed, 0 insertions, 0 deletions