aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-09-19 21:51:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:21 +0200
commit2c2eee9a95ef5ffc1d0b589c7813d9517134645b (patch)
tree9227e736a5ebf1236f9478ef38228c24a08ad314
parent784f511ff833f208bcf2a19efab1e616919cbb09 (diff)
downloadffmpeg-2c2eee9a95ef5ffc1d0b589c7813d9517134645b.tar.gz
oavformat/avidec: Check offset in odml
Fixes: signed integer overflow: 9223372036854775807 + 8 cannot be represented in type 'long' Fixes: 38787/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-4859845799444480 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 255a7b423ed5e07536bdc72e993056daa4efe009) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/avidec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index d24f36fa14..20ce107f34 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -240,7 +240,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num)
avio_rl32(pb); /* size */
duration = avio_rl32(pb);
- if (avio_feof(pb))
+ if (avio_feof(pb) || offset > INT64_MAX - 8)
return AVERROR_INVALIDDATA;
pos = avio_tell(pb);