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);