summaryrefslogtreecommitdiff
path: root/libavcodec/mpc8.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2009-06-13 06:41:51 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-06-13 06:41:51 +0000
commit0d5390b06256c6efa216a9aaf72a9b4d8597f20a (patch)
treeb7e9700424436871ec7bca6afef3473dba437009 /libavcodec/mpc8.c
parent8c1ff0abae34f171ba9c2e9319983fc9e163059e (diff)
Correct reading bits in MPC SV8 base codes (when we have to read 0 or >16 bits).
Originally committed as revision 19182 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpc8.c')
-rw-r--r--libavcodec/mpc8.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index 349a01e952..e1b3866b0b 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -44,7 +44,8 @@ static const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OF
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];