[FFmpeg-cvslog] aascdec: Check input buffer size on raw data.

Michael Niedermayer git at videolan.org
Tue Dec 13 19:30:47 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 13 15:45:04 2011 +0100| [be5db7004f9d7b42b5ae9068b181dff383367e36] | committer: Michael Niedermayer

aascdec: Check input buffer size on raw data.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/aasc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c
index 919bbc7..197bfe5 100644
--- a/libavcodec/aasc.c
+++ b/libavcodec/aasc.c
@@ -79,8 +79,13 @@ static int aasc_decode_frame(AVCodecContext *avctx,
     case 0:
         stride = (avctx->width * 3 + 3) & ~3;
         for(i = avctx->height - 1; i >= 0; i--){
+            if(avctx->width*3 > buf_size){
+                av_log(avctx, AV_LOG_ERROR, "Next line is beyond buffer bounds\n");
+                break;
+            }
             memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width*3);
             buf += stride;
+            buf_size -= stride;
         }
         break;
     case 1:



More information about the ffmpeg-cvslog mailing list