[FFmpeg-cvslog] 8svx: log an error message if output buffer is too small

Justin Ruggles git at videolan.org
Fri Sep 23 00:37:50 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Sep  6 18:49:07 2011 -0400| [fda459cee7a4227c34dfbc5dca1427c00d0d792e] | committer: Justin Ruggles

8svx: log an error message if output buffer is too small

Based on a patch by Stefano Sabatini.
git.videolan.org/ffmpeg.git
commit e280a4da2ae6fd44f0079358ecc5aa08e388a5ed

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

 libavcodec/8svx.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
index 0f53d39..af3b5fe 100644
--- a/libavcodec/8svx.c
+++ b/libavcodec/8svx.c
@@ -83,8 +83,11 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *data_si
         buf += 2;
     }
 
-    if (*data_size < buf_size * 2)
+    if (*data_size < buf_size * 2) {
+        av_log(avctx, AV_LOG_ERROR, "Provided buffer with size %d is too small.\n",
+               *data_size);
         return AVERROR(EINVAL);
+    }
 
     delta_decode(out_data, buf, buf_size, &esc->fib_acc, esc->table);
 



More information about the ffmpeg-cvslog mailing list