Browse Source

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>
tags/n4.2
Michael Niedermayer 5 years ago
parent
commit
8df6884832
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/utils.c

+ 1
- 1
libavcodec/utils.c View File

@@ -1024,7 +1024,7 @@ end:


return ret; return ret;
free_and_end: free_and_end:
if (avctx->codec &&
if (avctx->codec && avctx->codec->close &&
(codec_init_ok || (codec_init_ok ||
(avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP))) (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
avctx->codec->close(avctx); avctx->codec->close(avctx);


Loading…
Cancel
Save