Browse Source

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 5552ceaf56)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3.2
Michael Niedermayer 4 years ago
parent
commit
f678e8196c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/wtvdec.c

+ 1
- 1
libavformat/wtvdec.c View File

@@ -794,7 +794,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;


Loading…
Cancel
Save