diff --git a/libavcodec/utils.c b/libavcodec/utils.c index f5f9f2f0d1..cd7bc1c09a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -832,8 +832,10 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec) if (codec->priv_data_size > 0) { avctx->priv_data = av_mallocz(codec->priv_data_size); - if (!avctx->priv_data) + if (!avctx->priv_data) { + ret = AVERROR(ENOMEM); goto end; + } } else { avctx->priv_data = NULL; }