diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-18 19:18:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-20 14:38:28 +0200 |
commit | d2b0aae5e1b298075c7e840828b67a4236669f78 (patch) | |
tree | d9e69da909f3f00b1137c3b6c1dae492a7128c8e | |
parent | 8fe79605fdcec35f2b277126f5de2d0338468a90 (diff) | |
download | ffmpeg-d2b0aae5e1b298075c7e840828b67a4236669f78.tar.gz |
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@niedermayer.cc>
(cherry picked from commit 599d746e07319dc792ed2e511b666fe482f1ff88)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vp8.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 57d1eb10b8..9017ab8c5d 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -633,6 +633,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); |