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)