avformat/av1dec: check size before addition in probing

Fixes: signed integer overflow: 175 + 2147483571 cannot be represented in type 'int'
Fixes: 26833/clusterfuzz-testcase-minimized-ffmpeg_dem_IMAGE2_fuzzer-5969501214212096

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 2020-11-05 20:04:20 +01:00
parent 47c146a56b
commit 76b6c46a81

View File

@ -361,7 +361,7 @@ static int obu_probe(const AVProbeData *p)
ret = read_obu_with_size(p->buf + cnt, p->buf_size - cnt, &obu_size, &type);
if (ret < 0 || obu_size <= 0)
return 0;
cnt += ret;
cnt += FFMIN(ret, p->buf_size - cnt);
ret = get_score(type, &seq);
if (ret >= 0)