qdm2: fix out of stack array read.

The read value is not used when its outside the array.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/8/head
Michael Niedermayer 12 years ago
parent 2672b2c1d2
commit 2b12d1ffd8
  1. 4
      libavcodec/qdm2.c

@ -928,10 +928,10 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le
if (joined_stereo) {
float tmp[10][MPA_MAX_CHANNELS];
for (k = 0; k < run; k++) {
tmp[k][0] = samples[k];
tmp[k][1] = (sign_bits[(j + k) / 8]) ? -samples[k] : samples[k];
if ((j + k) < 128)
tmp[k][1] = (sign_bits[(j + k) / 8]) ? -samples[k] : samples[k];
}
for (chs = 0; chs < q->nb_channels; chs++)
for (k = 0; k < run; k++)

Loading…
Cancel
Save