ra288: log an error message when output buffer is too small.
authorJustin Ruggles <justin.ruggles@gmail.com>
Wed, 14 Sep 2011 18:46:50 +0000 (14:46 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Mon, 10 Oct 2011 15:38:58 +0000 (11:38 -0400)
also return AVERROR(EINVAL) instead of -1.

libavcodec/ra288.c

index f14c28d..2166d8c 100644 (file)
@@ -181,8 +181,10 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
 
     out_size = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME *
                av_get_bytes_per_sample(avctx->sample_fmt);
-    if (*data_size < out_size)
-        return -1;
+    if (*data_size < out_size) {
+        av_log(avctx, AV_LOG_ERROR, "Output buffer is too small\n");
+        return AVERROR(EINVAL);
+    }
 
     init_get_bits(&gb, buf, avctx->block_align * 8);