diff options
author | Kenan Gillet <kenan.gillet@gmail.com> | 2009-04-15 19:28:28 +0000 |
---|---|---|
committer | Reynaldo H. Verdejo Pinochet <reynaldo@opendot.cl> | 2009-04-15 19:28:28 +0000 |
commit | 807c4c787597407038750dcae6935134ed0f9015 (patch) | |
tree | af6e1b25fe0b089bb47b58c6e4033e38745ed312 /libavcodec | |
parent | c21c835b8d2dae324c544920ac0b3e8d583e0b99 (diff) | |
download | ffmpeg-807c4c787597407038750dcae6935134ed0f9015.tar.gz |
Fix possibly harmful outbound addressing. Patch by Kenan Gillet.
Originally committed as revision 18528 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/celp_filters.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/celp_filters.c b/libavcodec/celp_filters.c index a48368f242..ef1a578f44 100644 --- a/libavcodec/celp_filters.c +++ b/libavcodec/celp_filters.c @@ -61,15 +61,14 @@ int ff_celp_lp_synthesis_filter( { int i,n; - // These two lines are to avoid a -1 subtraction in the main loop + // This line is to avoid a +1 subtraction in the main loop. filter_length++; - filter_coeffs--; for(n=0; n<buffer_length; n++) { int sum = rounder; for(i=1; i<filter_length; i++) - sum -= filter_coeffs[i] * out[n-i]; + sum -= filter_coeffs[i-1] * out[n-i]; sum = (sum >> 12) + in[n]; @@ -94,14 +93,13 @@ void ff_celp_lp_synthesis_filterf( { int i,n; - // These two lines are to avoid a -1 subtraction in the main loop + // This line is to avoid a +1 subtraction in the main loop filter_length++; - filter_coeffs--; for(n=0; n<buffer_length; n++) { out[n] = in[n]; for(i=1; i<filter_length; i++) - out[n] -= filter_coeffs[i] * out[n-i]; + out[n] -= filter_coeffs[i-1] * out[n-i]; } } |