aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-21 13:43:19 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:47 +0100
commit86d36769e9eccedfcbd16f14dbd777ae8cab673a (patch)
treefbd073d9b08d1f75ae9d6a4eff16a15287e9adc0 /libavformat
parent8c550c8e25cda70e8ee1648b8c5307e482739ecc (diff)
downloadffmpeg-86d36769e9eccedfcbd16f14dbd777ae8cab673a.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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c
index 1236efa712..fc1731f26e 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;
}