[FFmpeg-devel,3/3] avcodec/utils: fix leak of subtitle_header on error path

Submitted by Michael Niedermayer on July 4, 2019, 11:28 p.m.

Details

Message ID 20190704232835.32235-3-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer July 4, 2019, 11:28 p.m.
Fixes: memleak
Fixes: 15528/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_STL_fuzzer-5735993371525120

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/utils.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1b1feca38c..56ff70b744 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1038,6 +1038,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
 
     av_dict_free(&tmp);
     av_freep(&avctx->priv_data);
+    av_freep(&avctx->subtitle_header);
     if (avctx->internal) {
         av_frame_free(&avctx->internal->to_free);
         av_frame_free(&avctx->internal->compat_decode_frame);