[FFmpeg-cvslog] sonicenc: fix off by 1 error
Michael Niedermayer
git at videolan.org
Wed Jun 19 10:39:52 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jun 19 10:06:38 2013 +0200| [ddefb80c95d88e88aeb7bc938d58c0389bb83b78] | committer: Michael Niedermayer
sonicenc: fix off by 1 error
Fixes out of array accesses
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ddefb80c95d88e88aeb7bc938d58c0389bb83b78
---
libavcodec/sonic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index 512e89e..cb7309c 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list