1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/eamad: Fix runtime error: signed integer overflow: 49674 * 49858 cannot be represented in type 'int'

Fixes: 1394/clusterfuzz-testcase-minimized-6493376885030912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-05-07 15:42:17 +02:00
parent c04aa14882
commit 0ac1c87194

View File

@ -284,7 +284,7 @@ static int decode_frame(AVCodecContext *avctx,
if (avctx->width != width || avctx->height != height) { if (avctx->width != width || avctx->height != height) {
av_frame_unref(s->last_frame); av_frame_unref(s->last_frame);
if((width * height)/2048*7 > bytestream2_get_bytes_left(&gb)) if((width * (int64_t)height)/2048*7 > bytestream2_get_bytes_left(&gb))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if ((ret = ff_set_dimensions(avctx, width, height)) < 0) if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret; return ret;