summaryrefslogtreecommitdiff
path: root/libavcodec/mpc.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-03-10 14:28:08 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-03-10 14:28:08 -0800
commitd7eabd50425a61b31e90c763a0c3e4316a725404 (patch)
tree7d19e9dd612725c7207c88fcf035d929bab236ee /libavcodec/mpc.c
parent442c3a8cb1785d74f8e2d7ab35b1862b7088436b (diff)
mpc: pad mpc_CC/SCF[] tables to allow for negative indices.
MPC8 allows indices of mpc_CC up to -1, and mpc_SCF up to -6, thus pad the tables by that much on the left end. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/mpc.c')
-rw-r--r--libavcodec/mpc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c
index 4573860525..6b15a33e5a 100644
--- a/libavcodec/mpc.c
+++ b/libavcodec/mpc.c
@@ -78,13 +78,13 @@ void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data, int ch
for(ch = 0; ch < 2; ch++){
if(bands[i].res[ch]){
j = 0;
- mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][0]];
+ mul = mpc_CC[bands[i].res[ch] + 1] * mpc_SCF[bands[i].scf_idx[ch][0]+6];
for(; j < 12; j++)
c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
- mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][1]];
+ mul = mpc_CC[bands[i].res[ch] + 1] * mpc_SCF[bands[i].scf_idx[ch][1]+6];
for(; j < 24; j++)
c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
- mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][2]];
+ mul = mpc_CC[bands[i].res[ch] + 1] * mpc_SCF[bands[i].scf_idx[ch][2]+6];
for(; j < 36; j++)
c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
}