summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-03-08 11:25:14 +0100
committerChristian König <deathsimple@vodafone.de>2012-03-08 14:13:14 +0100
commit39565d4a73e5b96f3de1a9a33acebac3c791af58 (patch)
treeb22084fa15a84e1c1591b72317b43a250f83823b
parentab832b5334a648ead395ac7aec3315600a96ec3f (diff)
vl/mpeg12: make bitstream decoder more robust
Just another xine workaround. Signed-off-by: Christian König <deathsimple@vodafone.de>
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_vlc.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
index f0ad2e49a3..23580463df 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 baaa48a0fe..6223fabf57 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;
}