vl: Fix inverted logic in vlc checks
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>
Sat, 24 Dec 2011 11:33:30 +0000 (12:33 +0100)
committerChristian König <deathsimple@vodafone.de>
Sat, 24 Dec 2011 14:36:46 +0000 (15:36 +0100)
Reported-by: Andy Furniss <andyqos@ukfsn.org>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
src/gallium/auxiliary/vl/vl_vlc.h

index ff0c4b52490679f5a5ab75003dec092e114592bf..baaa48a0fef237c9884f7de7ffe1adb7c2ccc861 100644 (file)
@@ -215,7 +215,7 @@ vl_vlc_bits_left(struct vl_vlc *vlc)
 static INLINE unsigned
 vl_vlc_peekbits(struct vl_vlc *vlc, unsigned num_bits)
 {
-   assert(vl_vlc_valid_bits(vlc) <= num_bits || vlc->data >= vlc->end);
+   assert(vl_vlc_valid_bits(vlc) >= num_bits || vlc->data >= vlc->end);
    return vlc->buffer >> (64 - num_bits);
 }
 
@@ -225,7 +225,7 @@ vl_vlc_peekbits(struct vl_vlc *vlc, unsigned num_bits)
 static INLINE void
 vl_vlc_eatbits(struct vl_vlc *vlc, unsigned num_bits)
 {
-   assert(vl_vlc_valid_bits(vlc) <= num_bits);
+   assert(vl_vlc_valid_bits(vlc) >= num_bits);
 
    vlc->buffer <<= num_bits;
    vlc->invalid_bits += num_bits;
@@ -239,7 +239,7 @@ vl_vlc_get_uimsbf(struct vl_vlc *vlc, unsigned num_bits)
 {
    unsigned value;
 
-   assert(vl_vlc_valid_bits(vlc) <= num_bits);
+   assert(vl_vlc_valid_bits(vlc) >= num_bits);
 
    value = vlc->buffer >> (64 - num_bits);
    vl_vlc_eatbits(vlc, num_bits);
@@ -255,7 +255,7 @@ vl_vlc_get_simsbf(struct vl_vlc *vlc, unsigned num_bits)
 {
    signed value;
 
-   assert(vl_vlc_valid_bits(vlc) <= num_bits);
+   assert(vl_vlc_valid_bits(vlc) >= num_bits);
 
    value = ((int64_t)vlc->buffer) >> (64 - num_bits);
    vl_vlc_eatbits(vlc, num_bits);