[vlc-devel] commit: Fix off by 1 errors (CID 42 and 43). (Antoine Cellerier )

git version control git at videolan.org
Fri May 30 15:05:50 CEST 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Fri May 30 15:07:25 2008 +0200| [3d90c11d8e9c238cd594a52f3dd026dea7f5cd57]

Fix off by 1 errors (CID 42 and 43).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3d90c11d8e9c238cd594a52f3dd026dea7f5cd57
---

 modules/visualization/visual/effects.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/visualization/visual/effects.c b/modules/visualization/visual/effects.c
index 62e88fc..ee209b1 100644
--- a/modules/visualization/visual/effects.c
+++ b/modules/visualization/visual/effects.c
@@ -177,7 +177,7 @@ int spectrum_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
     }
     fft_perform( p_buffer1, p_output, p_state);
     for(i= 0; i< FFT_BUFFER_SIZE ; i++ )
-        p_dest[i] = ( (int) sqrt( p_output [ i + 1 ] ) ) >> 8;
+        p_dest[i] = ( (int) sqrt( p_output [ i ] ) ) >> 8;
 
     for ( i = 0 ; i< i_nb_bands ;i++)
     {
@@ -477,7 +477,7 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
     }
     fft_perform( p_buffer1, p_output, p_state);
     for(i= 0; i< FFT_BUFFER_SIZE ; i++ )
-        p_dest[i] = ( (int) sqrt( p_output [ i + 1 ] ) ) >> 8;
+        p_dest[i] = ( (int) sqrt( p_output [ i ] ) ) >> 8;
 
     i_nb_bands *= i_sections;
 




More information about the vlc-devel mailing list