Commit a85ce653 authored by Jindřich Makovička's avatar Jindřich Makovička Committed by Diego Biurrun

mpeg12: check for available bits to avoid an infinite loop

Signed-off-by: 's avatarJindrich Makovicka <makovick@gmail.com>
Signed-off-by: 's avatarDiego Biurrun <diego@biurrun.de>
parent e5903e29
......@@ -1658,7 +1658,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
if (mb_y == 0 && s->codec_tag == AV_RL32("SLIF")) {
skip_bits1(&s->gb);
} else {
for (;;) {
while (get_bits_left(&s->gb) > 0) {
int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
if (code < 0) {
av_log(s->avctx, AV_LOG_ERROR, "first mb_incr damaged\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment