[FFmpeg-cvslog] h261: check mtype.
Michael Niedermayer
git at videolan.org
Fri May 11 22:45:40 CEST 2012
ffmpeg | branch: release/0.5 | Michael Niedermayer <michaelni at gmx.at> | Fri Mar 2 15:58:14 2012 +0100| [96c6b3a11c47555ad269404b62078124b7bb6ebf] | committer: Michael Niedermayer
h261: check mtype.
Fixes out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit ec3cd74f2dab8e3e8234ccb994132b23d3098585)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=96c6b3a11c47555ad269404b62078124b7bb6ebf
---
libavcodec/h261dec.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 7054286..aa1be6f 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -285,6 +285,10 @@ static int h261_decode_mb(H261Context *h){
// Read mtype
h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
+ if (h->mtype < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "illegal mtype %d\n", h->mtype);
+ return SLICE_ERROR;
+ }
h->mtype = h261_mtype_map[h->mtype];
// Read mquant
More information about the ffmpeg-cvslog
mailing list