diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4539cb945e..2129c9d154 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -830,12 +830,12 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec) avctx->codec_id = codec->id; avctx->frame_number = 0; if(avctx->codec->init){ - ret = avctx->codec->init(avctx); - if (ret < 0) { - av_freep(&avctx->priv_data); - avctx->codec= NULL; - goto end; - } + ret = avctx->codec->init(avctx); + if (ret < 0) { + av_freep(&avctx->priv_data); + avctx->codec= NULL; + goto end; + } } ret=0; end: