diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-30 23:50:32 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-10 17:04:26 +0300 |
commit | f226e4b469699cf6acc7d014c9ad4d3b1c45a638 (patch) | |
tree | b8c04b425073dc8c7ee748d92ebabfd797ed9d8e /libavformat/mpc8.c | |
parent | 8d3dd028a5ee52f0d19a6040fe8d963b7f4a68d1 (diff) |
avformat/mpc8: correct integer overflow in mpc8_parse_seektable()
Fixes: signed integer overflow: -4683718486770919638 * 2 cannot be represented in type 'long'
Fixes: 26704/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6327056939614208
Fixes: 27550/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6259212652642304
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 0897402ac8a2045691395380a9fd2ea88c0d3798)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mpc8.c')
-rw-r--r-- | libavformat/mpc8.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index ad3ad47aa3..6cc5bda9e0 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -181,7 +181,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) t += get_bits(&gb, 12); if(t & 1) t = -(t & ~1); - pos = (t >> 1) + ppos[0]*2 - ppos[1]; + pos = (t >> 1) + (uint64_t)ppos[0]*2 - ppos[1]; av_add_index_entry(s->streams[0], pos, (int64_t)i << seekd, 0, 0, AVINDEX_KEYFRAME); ppos[1] = ppos[0]; ppos[0] = pos; |