diff options
| author | Michael Niedermayer <[email protected]> | 2020-10-30 21:50:32 +0100 |
|---|---|---|
| committer | Michael Niedermayer <[email protected]> | 2021-09-09 13:53:29 +0200 |
| commit | 6eba6551b81b36e7233601f5a1f8b4c184a16890 (patch) | |
| tree | fdf1b3e62a83c99f57d6ae53537d52bf3341301c | |
| parent | 1e4a9d64d1f361aa2f475f3006524d2526c5a359 (diff) | |
avformat/mpc8: Check remaining space in mpc8_parse_seektable()
Fixes: Fixes infinite loop
Fixes: 26704/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6327056939614208
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 4f66dd13d08d063e2748d172239df595078ff624)
Signed-off-by: Michael Niedermayer <[email protected]>
| -rw-r--r-- | libavformat/mpc8.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 5def974564..10a7d9b54b 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -177,6 +177,10 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) av_add_index_entry(s->streams[0], pos, i, 0, 0, AVINDEX_KEYFRAME); } for(; i < size; i++){ + if (get_bits_left(&gb) < 13) { + av_free(buf); + return; + } t = get_unary(&gb, 1, 33) << 12; t += get_bits(&gb, 12); if(t & 1) |
