From 85dbb227964d5533a497dbda4803fdf43ad9567f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Thu, 8 Mar 2012 11:25:14 +0100 Subject: [PATCH] vl/mpeg12: make bitstream decoder more robust MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Just another xine workaround. Signed-off-by: Christian König --- src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c | 2 ++ src/gallium/auxiliary/vl/vl_vlc.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c index f0ad2e4..2358046 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c @@ -825,6 +825,8 @@ decode_slice(struct vl_mpg12_bs *bs, struct pipe_video_buffer *target) } inc += vl_vlc_get_vlclbf(&bs->vlc, tbl_B1, 11); if (x != -1) { + if (!inc) + return; mb.num_skipped_macroblocks = inc - 1; bs->decoder->decode_macroblock(bs->decoder, target, &bs->desc->base, &mb.base, 1); } diff --git a/src/gallium/auxiliary/vl/vl_vlc.h b/src/gallium/auxiliary/vl/vl_vlc.h index baaa48a..6223fab 100644 --- a/src/gallium/auxiliary/vl/vl_vlc.h +++ b/src/gallium/auxiliary/vl/vl_vlc.h @@ -271,7 +271,6 @@ vl_vlc_get_vlclbf(struct vl_vlc *vlc, const struct vl_vlc_entry *tbl, unsigned n { tbl += vl_vlc_peekbits(vlc, num_bits); vl_vlc_eatbits(vlc, tbl->length); - assert(tbl->length); return tbl->value; } -- 2.7.4