Browse Source

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>
tags/n4.4
Michael Niedermayer 4 years ago
parent
commit
76b6c46a81
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/av1dec.c

+ 1
- 1
libavformat/av1dec.c 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)


Loading…
Cancel
Save