aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-15 02:43:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-15 02:44:03 +0100
commit62006b539ddda23594febf0fcb2f21c03de60457 (patch)
treecc16e12de70fe08bbb57fecb7936633c46330925
parentcaa2fa2c69e760b3dad6358178ccbad39ba8a268 (diff)
downloadffmpeg-62006b539ddda23594febf0fcb2f21c03de60457.tar.gz
ituh263dec: more complete w/h check.
Fixes a division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/ituh263dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 86c5c0638a..6c95636ab8 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -1075,6 +1075,10 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
s->qscale = get_bits(&s->gb, 5);
}
+ if (s->width == 0 || s->height == 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "dimensions 0\n");
+ return -1;
+ }
s->mb_width = (s->width + 15) / 16;
s->mb_height = (s->height + 15) / 16;
s->mb_num = s->mb_width * s->mb_height;