diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-21 13:43:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-06 20:30:57 +0100 |
commit | 5591681af13ba4b25c4d2c4c1783a448c36db7b1 (patch) | |
tree | f745d6c901f25d309a2c5e310b331791c42a5038 /libavformat | |
parent | e4667a6991968826155a2a74cc5a7fbff6f0c4e2 (diff) | |
download | ffmpeg-5591681af13ba4b25c4d2c4c1783a448c36db7b1.tar.gz |
avformat/mpsubdec: Clear queue on error
Fixes: Memleaks
Fixes: 17219/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5720539124989952
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9a0d36e562d53716cf000895c2f892fb1f48165d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpsubdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c index 7c26d4f42c..ecd85338a8 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -106,6 +106,9 @@ static int mpsub_read_header(AVFormatContext *s) ff_subtitles_queue_finalize(&mpsub->q); end: + if (res < 0) + ff_subtitles_queue_clean(&mpsub->q); + av_bprint_finalize(&buf, NULL); return res; } |