[FFmpeg-cvslog] avcodec/vp8: Check buffer size in vp8_decode_frame_header()

Michael Niedermayer git at videolan.org
Tue Jul 28 03:21:48 CEST 2015


ffmpeg | branch: release/2.5 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jul 18 19:18:24 2015 +0200| [be369f6e4034bee7630ea70d7b516bdee25ff40f] | committer: Michael Niedermayer

avcodec/vp8: Check buffer size in vp8_decode_frame_header()

avoids null pointer dereference
Fixes: signal_sigsegv_d5de40_964_vp80-00-comprehensive-010.ivf with memlimit of 1048576

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 599d746e07319dc792ed2e511b666fe482f1ff88)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 8313544..944db5e 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -639,6 +639,11 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
     int width  = s->avctx->width;
     int height = s->avctx->height;
 
+    if (buf_size < 3) {
+        av_log(s->avctx, AV_LOG_ERROR, "Insufficent data (%d) for header\n", buf_size);
+        return AVERROR_INVALIDDATA;
+    }
+
     s->keyframe  = !(buf[0] & 1);
     s->profile   =  (buf[0]>>1) & 7;
     s->invisible = !(buf[0] & 0x10);



More information about the ffmpeg-cvslog mailing list