vl/mpeg12: make bitstream decoder more robust
authorChristian König <deathsimple@vodafone.de>
Thu, 8 Mar 2012 10:25:14 +0000 (11:25 +0100)
committerChristian König <deathsimple@vodafone.de>
Fri, 9 Mar 2012 11:44:51 +0000 (12:44 +0100)
Just another xine workaround.

Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
src/gallium/auxiliary/vl/vl_vlc.h

index f0ad2e49a3b537d4bd502a1db80f0152c27c0fe1..23580463df9c8f75d8f824a1476d65cdc60f174d 100644 (file)
@@ -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);
       }
index baaa48a0fef237c9884f7de7ffe1adb7c2ccc861..6223fabf577f63204f2d711b432368f9609a99f4 100644 (file)
@@ -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;
 }