mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/nutdec: Check tmp_size
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6739990530883584 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:
parent
a1a277926b
commit
1ca00b5e44
@ -286,6 +286,11 @@ static int decode_main_header(NUTContext *nut)
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
if (tmp_size < 0 || tmp_size > INT_MAX - count) {
|
||||
av_log(s, AV_LOG_ERROR, "illegal size\n");
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (j = 0; j < count; j++, i++) {
|
||||
if (i == 'N') {
|
||||
|
Loading…
Reference in New Issue
Block a user