aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-11 18:54:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-12 11:22:04 +0200
commit36f962f3c209f2f402b1ef9091ebbb7a8d11c020 (patch)
treee3d701f56a6777e5021a6ec7a18c84a7b9286ef7
parent43a4d78e3bf1758d05434f8315115bab2619d75d (diff)
downloadffmpeg-36f962f3c209f2f402b1ef9091ebbb7a8d11c020.tar.gz
avformat/avidec: Use 64bit for frame number in odml index parsing
Fixes: signed integer overflow: 1179337772 + 1392508928 cannot be represented in type 'int' Fixes: 34088/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5846945303232512 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 a4c98c507ed3c729fc92d641b974385f8aa37b33) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/avidec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 46f24a8e55..eb7353ddba 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -156,7 +156,7 @@ static int get_riff(AVFormatContext *s, AVIOContext *pb)
return 0;
}
-static int read_odml_index(AVFormatContext *s, int frame_num)
+static int read_odml_index(AVFormatContext *s, int64_t frame_num)
{
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
@@ -176,7 +176,7 @@ static int read_odml_index(AVFormatContext *s, int frame_num)
av_log(s, AV_LOG_TRACE,
"longs_per_entry:%d index_type:%d entries_in_use:%d "
- "chunk_id:%X base:%16"PRIX64" frame_num:%d\n",
+ "chunk_id:%X base:%16"PRIX64" frame_num:%"PRId64"\n",
longs_per_entry,
index_type,
entries_in_use,