mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avcodec/exr: x/ymax cannot be INT_MAX
The code uses x/ymax + 1 so the maximum is INT_MAX-1
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 33158/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5545462457303040
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 48342aa075
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
701dc655da
commit
6de521a058
@ -1511,6 +1511,7 @@ static int decode_header(EXRContext *s, AVFrame *frame)
|
||||
ymax = bytestream2_get_le32(&s->gb);
|
||||
|
||||
if (xmin > xmax || ymin > ymax ||
|
||||
ymax == INT_MAX || xmax == INT_MAX ||
|
||||
(unsigned)xmax - xmin >= INT_MAX ||
|
||||
(unsigned)ymax - ymin >= INT_MAX) {
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
|
Loading…
Reference in New Issue
Block a user