diff --git a/libavcodec/bink.c b/libavcodec/bink.c index cc55870114..9a4ac246ab 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1299,13 +1299,13 @@ static av_cold int decode_init(AVCodecContext *avctx) } c->avctx = avctx; + if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0) + return ret; + c->last = av_frame_alloc(); if (!c->last) return AVERROR(ENOMEM); - if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0) - return ret; - avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; ff_blockdsp_init(&c->bdsp, avctx);