summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_vlc.h
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-08-29 10:36:06 +0200
committerChristian König <[email protected]>2011-08-29 10:36:06 +0200
commitd4bbdbd03893e900d8bcf0b46e8307a877d1a3ae (patch)
tree06da16274bc167bce2013b61e05d5f1aec8b6e1c /src/gallium/auxiliary/vl/vl_vlc.h
parentddd25cfbb05582963fc15a7ade1a9c5cd4a3ed27 (diff)
g3dvl: Fix a bug not decoding the last 32-64 bits of an mpeg2 bitstream.
Another bug found by Andy Furniss.
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_vlc.h')
-rw-r--r--src/gallium/auxiliary/vl/vl_vlc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/vl/vl_vlc.h b/src/gallium/auxiliary/vl/vl_vlc.h
index 4db1334d6a4..e17eae83fb3 100644
--- a/src/gallium/auxiliary/vl/vl_vlc.h
+++ b/src/gallium/auxiliary/vl/vl_vlc.h
@@ -113,9 +113,10 @@ vl_vlc_init(struct vl_vlc *vlc, const uint8_t *data, unsigned len)
}
static INLINE unsigned
-vl_vlc_bytes_left(struct vl_vlc *vlc)
+vl_vlc_bits_left(struct vl_vlc *vlc)
{
- return ((uint8_t*)vlc->end)-((uint8_t*)vlc->data);
+ signed bytes_left = ((uint8_t*)vlc->end)-((uint8_t*)vlc->data);
+ return bytes_left * 8 + vlc->valid_bits;
}
static INLINE unsigned