avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: 53098 * 40448 cannot be represented in type 'int'

Fixes: 2106/clusterfuzz-testcase-minimized-6136503639998464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-06-06 16:28:57 +02:00
parent c4360559ee
commit 18bca25adb
1 changed files with 2 additions and 2 deletions

View File

@ -2340,7 +2340,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
if (s->pict_type != AV_PICTURE_TYPE_B) { if (s->pict_type != AV_PICTURE_TYPE_B) {
s->last_time_base = s->time_base; s->last_time_base = s->time_base;
s->time_base += time_incr; s->time_base += time_incr;
s->time = s->time_base * s->avctx->framerate.num + time_increment; s->time = s->time_base * (int64_t)s->avctx->framerate.num + time_increment;
if (s->workaround_bugs & FF_BUG_UMP4) { if (s->workaround_bugs & FF_BUG_UMP4) {
if (s->time < s->last_non_b_time) { if (s->time < s->last_non_b_time) {
/* header is not mpeg-4-compatible, broken encoder, /* header is not mpeg-4-compatible, broken encoder,
@ -2352,7 +2352,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
s->pp_time = s->time - s->last_non_b_time; s->pp_time = s->time - s->last_non_b_time;
s->last_non_b_time = s->time; s->last_non_b_time = s->time;
} else { } else {
s->time = (s->last_time_base + time_incr) * s->avctx->framerate.num + time_increment; s->time = (s->last_time_base + time_incr) * (int64_t)s->avctx->framerate.num + time_increment;
s->pb_time = s->pp_time - (s->last_non_b_time - s->time); s->pb_time = s->pp_time - (s->last_non_b_time - s->time);
if (s->pp_time <= s->pb_time || if (s->pp_time <= s->pb_time ||
s->pp_time <= s->pp_time - s->pb_time || s->pp_time <= s->pp_time - s->pb_time ||