Commit ddefb80c authored by Michael Niedermayer's avatar Michael Niedermayer

sonicenc: fix off by 1 error

Fixes out of array accesses
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 694c2d1a
......@@ -430,7 +430,7 @@ static void modified_levinson_durbin(int *window, int window_entries,
int *x_ptr = &(window[step]);
int *state_ptr = &(state[0]);
j = window_entries - step;
for (;j>=0;j--,x_ptr++,state_ptr++)
for (;j>0;j--,x_ptr++,state_ptr++)
{
double x_value = *x_ptr;
double state_value = *state_ptr;
......@@ -465,7 +465,7 @@ static void modified_levinson_durbin(int *window, int window_entries,
x_ptr = &(window[step]);
state_ptr = &(state[0]);
j = window_entries - step;
for (;j>=0;j--,x_ptr++,state_ptr++)
for (;j>0;j--,x_ptr++,state_ptr++)
{
int x_value = *x_ptr;
int state_value = *state_ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment