---
 libavcodec/eatgv.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index fabc516..3602795 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -269,9 +269,11 @@ static int tgv_decode_frame(AVCodecContext *avctx,
         s->width  = AV_RL16(&buf[0]);
         s->height = AV_RL16(&buf[2]);
         if (s->avctx->width != s->width || s->avctx->height != s->height) {
-            avcodec_set_dimensions(s->avctx, s->width, s->height);
             av_freep(&s->frame_buffer);
             av_frame_unref(&s->last_frame);
+            ret = ff_set_dimensions(s->avctx, s->width, s->height);
+            if (ret < 0)
+                return ret;
         }
 
         pal_count = AV_RL16(&buf[6]);
@@ -282,9 +284,6 @@ static int tgv_decode_frame(AVCodecContext *avctx,
         }
     }
 
-    if ((ret = av_image_check_size(s->width, s->height, 0, avctx)) < 0)
-        return ret;
-
     if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
 
-- 
1.7.10.4

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to