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-12 16:46:06 +0200
commit501f0aef5d9e6a55bb84b800c41694ea6f3585ed (patch)
treec491fa1b7796869b568d3e2189ffcb97927ceb34
parentbbbde5f077d08fae91d1bd06fecf64b436f927cc (diff)
downloadffmpeg-501f0aef5d9e6a55bb84b800c41694ea6f3585ed.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 5b68e30034..7200b76e68 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -236,7 +236,7 @@ static int read_odml_index(AVFormatContext *s, int64_t 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);