ffmpeg | branch: release/3.2 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sun Jul 21 00:08:55 2019 +0200| [cb456b8fb00e04bedf117cb4b72c87a9c3db5145] | 
committer: James Almer

avcodec/utils: Check close before calling it

Fixes: NULL pointer dereference
Fixes: 
15733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IDF_fuzzer-5658616977162240

Reviewed-by: Paul B Mahol <one...@gmail.com>
Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit 8df6884832ec413cf032dfaa45c23b1c7876670c)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb456b8fb00e04bedf117cb4b72c87a9c3db5145
---

 libavcodec/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8f19237d3f..c8f4ff7973 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1720,7 +1720,7 @@ end:
 
     return ret;
 free_and_end:
-    if (avctx->codec &&
+    if (avctx->codec && avctx->codec->close &&
         (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP))
         avctx->codec->close(avctx);
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to