Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-04-25 21:01:03 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-06-18 19:58:25 +0300
commit1ca00b5e44f21840b608e238fa135a1aab6e576b (patch)
tree51c732c8caebe527ba247b7fe23595c401617870 /libavformat/nutdec.c
parenta1a277926b49dad60d9e78c6c7a8c6b5d0d6d7c9 (diff)
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>
Diffstat (limited to 'libavformat/nutdec.c')
-rw-r--r--libavformat/nutdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index e709257135..fc5a6a1542 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -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') {