aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-02-08 14:29:01 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:53:29 +0200
commitf083f20fd215ef8c0b7fa9f4abf885df6d322b8a (patch)
treeb61a4fd16a0a0d0678ff048333cc0550cf14c340 /libavformat
parenta4c627df67ce6d1fc5a52c830d270485cf205249 (diff)
downloadffmpeg-f083f20fd215ef8c0b7fa9f4abf885df6d322b8a.tar.gz
avformat/wtvdec: Check len in parse_chunks() to avoid overflow
Fixes: signed integer overflow: 2147483647 + 7 cannot be represented in type 'int' Fixes: 30084/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6192261941559296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5552ceaf568915e668679f9581e07eb5507cafc4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/wtvdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index ed3ebb3d89..6f4d266992 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -795,7 +795,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
ff_get_guid(pb, &g);
len = avio_rl32(pb);
- if (len < 32) {
+ if (len < 32 || len > INT_MAX - 7) {
int ret;
if (avio_feof(pb))
return AVERROR_EOF;