[FFmpeg-cvslog] wmv1: check that the input buffer is large enough

Michael Niedermayer git at videolan.org
Sat Jun 9 21:05:16 CEST 2012


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Fri Jun  1 21:42:29 2012 +0200| [321bbb6f496d3125d4b4507dc9fd280c1def5c98] | committer: Michael Niedermayer

wmv1: check that the input buffer is large enough

Fixes null ptr deref
Fixes Ticket1367

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit f23a2418fb0ccc56fdae4dbf83a5994cc917c475)

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

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

 libavcodec/wnv1.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index 6429a5b..6e4742e 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -70,6 +70,11 @@ static int decode_frame(AVCodecContext *avctx,
     int prev_y = 0, prev_u = 0, prev_v = 0;
     uint8_t *rbuf;
 
+    if(buf_size<=8) {
+        av_log(avctx, AV_LOG_ERROR, "buf_size %d is too small\n", buf_size);
+        return AVERROR_INVALIDDATA;
+    }
+
     rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
     if(!rbuf){
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");



More information about the ffmpeg-cvslog mailing list