[FFmpeg-cvslog] ra288: log an error message when output buffer is too small.

Justin Ruggles git at videolan.org
Tue Oct 11 03:52:33 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Sep 14 14:46:50 2011 -0400| [8f8f5ae9918460c358d8d8212e8c19cf3bdad374] | committer: Justin Ruggles

ra288: log an error message when output buffer is too small.

also return AVERROR(EINVAL) instead of -1.

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

 libavcodec/ra288.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index f14c28d..2166d8c 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -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);
 



More information about the ffmpeg-cvslog mailing list