diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-10 04:23:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-10 04:57:50 +0100 |
commit | 2b12d1ffd841cf57976b124c1882e4a23a7c5f61 (patch) | |
tree | aecadf592ecf7601e30c9cbbf9ca3d9c257573ed | |
parent | 2672b2c1d2d48af94c59c198287fae1c7a785710 (diff) | |
download | ffmpeg-2b12d1ffd841cf57976b124c1882e4a23a7c5f61.tar.gz |
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>
-rw-r--r-- | libavcodec/qdm2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index c8727c6b1c..ca2aab7b56 100644 --- a/libavcodec/qdm2.c +++ b/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++) |