]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/eamad.c
Merge commit 'cffecc0e7ebd642afaa1fb9f56fab1fcc283293c'
[ffmpeg] / libavcodec / eamad.c
index 6d8291e5149da9e21299cc4dcec7af86aedec6a9..9ef216fd690ff0d5fa1dc57d634c4ae5ad53a134 100644 (file)
@@ -263,12 +263,11 @@ static int decode_frame(AVCodecContext *avctx,
     }
 
     if (avctx->width != width || avctx->height != height) {
+        av_frame_unref(&s->last_frame);
         if((width * height)/2048*7 > buf_end-buf)
             return AVERROR_INVALIDDATA;
-        if ((ret = av_image_check_size(width, height, 0, avctx)) < 0)
+        if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
             return ret;
-        avcodec_set_dimensions(avctx, width, height);
-        av_frame_unref(&s->last_frame);
     }
 
     if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)