]> git.sesse.net Git - ffmpeg/commitdiff
aic: Improve error reporting
authorVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 15 Jun 2015 17:27:53 +0000 (18:27 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 17 Jun 2015 13:06:35 +0000 (14:06 +0100)
libavcodec/aic.c

index 5687dbeb00e30dc827ed9c589370289def748f64..4782294118d74488d94bf4a9e04e153d0b907a43 100644 (file)
@@ -385,8 +385,11 @@ static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = aic_decode_header(ctx, buf, buf_size)) < 0)
+    ret = aic_decode_header(ctx, buf, buf_size);
+    if (ret < 0) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid header\n");
         return ret;
+    }
 
     if ((ret = ff_get_buffer(avctx, ctx->frame, 0)) < 0)
         return ret;
@@ -398,13 +401,17 @@ static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         for (x = 0; x < ctx->mb_width; x += ctx->slice_width) {
             slice_size = bytestream2_get_le16(&gb) * 4;
             if (slice_size + off > buf_size || !slice_size) {
-                av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n");
+                av_log(avctx, AV_LOG_ERROR,
+                       "Incorrect slice size %d at %d.%d\n", slice_size, x, y);
                 return AVERROR_INVALIDDATA;
             }
 
-            if ((ret = aic_decode_slice(ctx, x, y,
-                                        buf + off, slice_size)) < 0)
+            ret = aic_decode_slice(ctx, x, y, buf + off, slice_size);
+            if (ret < 0) {
+                av_log(avctx, AV_LOG_ERROR,
+                       "Error decoding slice at %d.%d\n", x, y);
                 return ret;
+            }
 
             off += slice_size;
         }