diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-01 15:55:31 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-01 16:15:33 +0100 |
commit | b84211ac71ebed8ed0d8e3db26557f41f4a21e81 (patch) | |
tree | 98281f370b24d3ff9376485fa5e82fc99dde7a72 /libavcodec/mpc.c | |
parent | fd88a257015f183f5ec3bff393a2f6cf7c117c02 (diff) | |
download | ffmpeg-b84211ac71ebed8ed0d8e3db26557f41f4a21e81.tar.gz |
mpc: Fix mpc_SCF use and content.
This fixes a out of global array read.
This change is based on the reference mpc imlementation.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpc.c')
-rw-r--r-- | libavcodec/mpc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c index c2975ec732..7caf31229b 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]] * mpc_SCF[bands[i].scf_idx[ch][0] & 0xFF]; 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]] * mpc_SCF[bands[i].scf_idx[ch][1] & 0xFF]; 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]] * mpc_SCF[bands[i].scf_idx[ch][2] & 0xFF]; for(; j < 36; j++) c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off]; } |