svq1dec: avoid undefined get_bits(0) call
authorMans Rullgard <mans@mansr.com>
Sat, 26 Nov 2011 15:30:34 +0000 (15:30 +0000)
committerMans Rullgard <mans@mansr.com>
Fri, 2 Dec 2011 21:52:09 +0000 (21:52 +0000)
Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/svq1dec.c

index 8569615..7eb6e60 100644 (file)
@@ -195,7 +195,8 @@ static const uint8_t string_table[256] = {
 
 #define SVQ1_CALC_CODEBOOK_ENTRIES(cbook)\
       codebook = (const uint32_t *) cbook[level];\
-      bit_cache = get_bits (bitbuf, 4*stages);\
+      if (stages > 0)\
+        bit_cache = get_bits (bitbuf, 4*stages);\
       /* calculate codebook entries for this vector */\
       for (j=0; j < stages; j++) {\
         entries[j] = (((bit_cache >> (4*(stages - j - 1))) & 0xF) + 16*j) << (level + 1);\