[FFmpeg-cvslog] kgv1dec: return meaningful error codes.

Anton Khirnov git at videolan.org
Mon Jan 7 00:44:47 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Nov 16 22:40:36 2012 +0100| [405486c28bb4d953aa585be0f3742df984c16cb5] | committer: Anton Khirnov

kgv1dec: return meaningful error codes.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=405486c28bb4d953aa585be0f3742df984c16cb5
---

 libavcodec/kgv1dec.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
index fc99b21..01655a5 100644
--- a/libavcodec/kgv1dec.c
+++ b/libavcodec/kgv1dec.c
@@ -55,14 +55,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     int w, h, i, res;
 
     if (avpkt->size < 2)
-        return -1;
+        return AVERROR_INVALIDDATA;
 
     w = (buf[0] + 1) * 8;
     h = (buf[1] + 1) * 8;
     buf += 2;
 
-    if (av_image_check_size(w, h, 0, avctx))
-        return -1;
+    if ((res = av_image_check_size(w, h, 0, avctx)) < 0)
+        return res;
 
     if (w != avctx->width || h != avctx->height) {
         if (c->prev.data[0])



More information about the ffmpeg-cvslog mailing list