aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorBenjamin Larsson <banan@ludd.ltu.se>2008-07-19 18:53:04 +0000
committerBenjamin Larsson <banan@ludd.ltu.se>2008-07-19 18:53:04 +0000
commitd11f9e1b15e3aac6862bdfe2e5cb212b706e2c2f (patch)
tree96b1bb97dfd78d1ca9124fa6287592f1c81263ce /libavcodec
parentfb19e1443bc45e192545d3485ddb9c76e7d77855 (diff)
downloadffmpeg-d11f9e1b15e3aac6862bdfe2e5cb212b706e2c2f.tar.gz
Prevent the qdm2 code from overreading/overflowing. Fixes Coverity ID 112 run 2
Originally committed as revision 14309 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/qdm2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index e4a7878a8c..203312144a 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -684,7 +684,7 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
SAMPLES_NEEDED
for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++) {
- for (j = 1; j < 64; j++) {
+ for (j = 1; j < 63; j++) { // The loop only iterates to 63 so the code doesn't overflow the buffer
add1 = tone_level_idx[ch][sb][j] - 10;
if (add1 < 0)
add1 = 0;