diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-05 20:04:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-12-06 21:00:03 +0100 |
commit | 76b6c46a81f420ffa04211d4b598547f14b67cb7 (patch) | |
tree | b3b4f9fe0be039588d5e6040f31d1ae45df93f89 /libavformat/av1dec.c | |
parent | 47c146a56b5f6641dcf02bbaa056588d5536c582 (diff) | |
download | ffmpeg-76b6c46a81f420ffa04211d4b598547f14b67cb7.tar.gz |
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>
Diffstat (limited to 'libavformat/av1dec.c')
-rw-r--r-- | libavformat/av1dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c index 395eef6522..5ae81b34d4 100644 --- a/libavformat/av1dec.c +++ b/libavformat/av1dec.c @@ -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) |