avcodec/utvideodec: Fix integer overflow in decode_plane()

Fixes: signed integer overflow: 2147483594 + 142 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5658568101724160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 876cfa67f3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-05-10 21:16:59 +02:00
parent 186599c86f
commit 2a9ed44fe2

View File

@ -109,7 +109,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
for (i = 0; i < width * step; i += step) {
pix = fsym;
if (use_pred) {
prev += pix;
prev += (unsigned)pix;
pix = prev;
}
dest[i] = pix;