]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/eacmv: Return more specific error codes and forward error codes
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 31 Dec 2018 17:59:49 +0000 (18:59 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 1 Jan 2019 20:11:47 +0000 (21:11 +0100)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/eacmv.c

index bf4404ce4263531a53605a8cd259af3b635d5267..6f39d72b88d61a0279150655d8aefb2c361c3aa8 100644 (file)
@@ -191,12 +191,12 @@ static int cmv_decode_frame(AVCodecContext *avctx,
         if (ret < 0)
             return ret;
         if (size > buf_end - buf - EA_PREAMBLE_SIZE)
-            return -1;
+            return AVERROR_INVALIDDATA;
         buf += size;
     }
 
-    if (av_image_check_size(s->width, s->height, 0, s->avctx))
-        return -1;
+    if ((ret = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
+        return ret;
 
     if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;