[FFmpeg-cvslog] h264: prevent overreads in intra PCM decoding.
Ronald S. Bultje
git at videolan.org
Mon Apr 2 01:45:21 CEST 2012
ffmpeg | branch: release/0.8 | Ronald S. Bultje <rsbultje at gmail.com> | Tue Feb 28 18:48:27 2012 -0800| [bd37b95383b6bd6b69aa8dba8eebd2cbef2aeed8] | committer: Reinhard Tartler
h264: prevent overreads in intra PCM decoding.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit d1604b3de96575195b219028e2c4f08b2259aa7d)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd37b95383b6bd6b69aa8dba8eebd2cbef2aeed8
---
libavcodec/h264_cabac.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index e8c8503..ae3318d 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1958,6 +1958,8 @@ decode_intra_mb:
}
// The pixels are stored in the same order as levels in h->mb array.
+ if ((int) (h->cabac.bytestream_end - ptr) < mb_size)
+ return -1;
memcpy(h->mb, ptr, mb_size); ptr+=mb_size;
ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr);
More information about the ffmpeg-cvslog
mailing list