[FFmpeg-cvslog] qdm2: fix out of stack array read.
Michael Niedermayer
git at videolan.org
Thu Jan 10 05:55:54 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 10 04:23:14 2013 +0100| [2b12d1ffd841cf57976b124c1882e4a23a7c5f61] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2b12d1ffd841cf57976b124c1882e4a23a7c5f61
---
libavcodec/qdm2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index c8727c6..ca2aab7 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++)
More information about the ffmpeg-cvslog
mailing list