aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-21 13:43:19 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-08 16:24:58 +0200
commit9a0d36e562d53716cf000895c2f892fb1f48165d (patch)
tree301b2406579a906f1177a0f5144bd8243263be08
parentbf0ba75c4a9231ed62afe60bed5bde2728971e30 (diff)
downloadffmpeg-9a0d36e562d53716cf000895c2f892fb1f48165d.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>
-rw-r--r--libavformat/mpsubdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c
index 3d8dcb35c2..82c73457ea 100644
--- a/libavformat/mpsubdec.c
+++ b/libavformat/mpsubdec.c
@@ -163,6 +163,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;
}