Skip to content
Snippets Groups Projects
Commit d11f9e1b authored by Benjamin Larsson's avatar Benjamin Larsson
Browse files

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
parent fb19e144
No related branches found
No related tags found
No related merge requests found
...@@ -684,7 +684,7 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra ...@@ -684,7 +684,7 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
SAMPLES_NEEDED SAMPLES_NEEDED
for (ch = 0; ch < nb_channels; ch++) for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++) { 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; add1 = tone_level_idx[ch][sb][j] - 10;
if (add1 < 0) if (add1 < 0)
add1 = 0; add1 = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment