diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-21 13:43:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-31 19:51:56 +0100 |
commit | 71f3bb58dfd398b65a7c9399d6fc05388aa517be (patch) | |
tree | 2d5429e9ff20dfaab4d48797f0d6f967c3d27ca8 | |
parent | fb8e3a5b44e47b2ee51ab7ab5f7a00e7e20ce32d (diff) | |
download | ffmpeg-71f3bb58dfd398b65a7c9399d6fc05388aa517be.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>
-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 4ff49ba3cf..b00f0f114d 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -106,6 +106,9 @@ static int mpsub_read_header(AVFormatContext *s) ff_subtitles_queue_finalize(s, &mpsub->q); end: + if (res < 0) + ff_subtitles_queue_clean(&mpsub->q); + av_bprint_finalize(&buf, NULL); return res; } |