Skip to content

Commit 8df6884

Browse files
committed
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 <onemda@gmail.com> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 508ce58 commit 8df6884

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libavcodec/utils.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
10241024

10251025
return ret;
10261026
free_and_end:
1027-
if (avctx->codec &&
1027+
if (avctx->codec && avctx->codec->close &&
10281028
(codec_init_ok ||
10291029
(avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
10301030
avctx->codec->close(avctx);

0 commit comments

Comments
 (0)