diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 1774f36c3b47465c6afd030e6d2eee3c4db224f6..62b5c6e2332349e019d7d5cde1bf569eebae6398 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -61,12 +61,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, h = (buf[1] + 1) * 8; buf += 2; - if ((res = av_image_check_size(w, h, 0, avctx)) < 0) - return res; - if (w != avctx->width || h != avctx->height) { av_frame_unref(&c->prev); - avcodec_set_dimensions(avctx, w, h); + if ((res = ff_set_dimensions(avctx, w, h)) < 0) + return res; } maxcnt = w * h;