bethsoftvideo: return meaningfull error codes
authorPaul B Mahol <onemda@gmail.com>
Sat, 13 Oct 2012 08:05:42 +0000 (08:05 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sat, 13 Oct 2012 08:07:41 +0000 (08:07 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/bethsoftvideo.c

index 427d83c..8eec5b7 100644 (file)
@@ -77,9 +77,9 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
     int code, ret;
     int yoffset;
 
-    if (avctx->reget_buffer(avctx, &vid->frame)) {
+    if ((ret = avctx->reget_buffer(avctx, &vid->frame)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return -1;
+        return ret;
     }
     wrap_to_next_line = vid->frame.linesize[0] - avctx->width;
 
@@ -107,7 +107,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
         case VIDEO_YOFF_P_FRAME:
             yoffset = bytestream2_get_le16(&vid->g);
             if(yoffset >= avctx->height)
-                return -1;
+                return AVERROR_INVALIDDATA;
             dst += vid->frame.linesize[0] * yoffset;
     }