changeset 9849:d1119c095555 libavcodec

Correct reading bits in MPC SV8 base codes (when we have to read 0 or >16 bits).
author kostya
date Sat, 13 Jun 2009 06:41:51 +0000
parents 173ec947655f
children 63dbab428e01
files mpc8.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mpc8.c	Sat Jun 13 02:19:41 2009 +0000
+++ b/mpc8.c	Sat Jun 13 06:41:51 2009 +0000
@@ -44,7 +44,8 @@
 
 static inline int mpc8_dec_base(GetBitContext *gb, int k, int n)
 {
-    int code = get_bits(gb, mpc8_cnk_len[k-1][n-1] - 1);
+    int len = mpc8_cnk_len[k-1][n-1] - 1;
+    int code = len ? get_bits_long(gb, len) : 0;
 
     if (code >= mpc8_cnk_lost[k-1][n-1])
         code = ((code << 1) | get_bits1(gb)) - mpc8_cnk_lost[k-1][n-1];