[vlc-devel] commit: visual: fix a crash (double free or use after free) if an error occure. ( Rémi Duraffort )
git version control
git at videolan.org
Thu Nov 19 16:27:30 CET 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Nov 19 13:57:09 2009 +0100| [5d99f7d3d511734c10f462f74114e85fa794d21b] | committer: Rémi Duraffort
visual: fix a crash (double free or use after free) if an error occure.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5d99f7d3d511734c10f462f74114e85fa794d21b
---
modules/visualization/visual/effects.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/modules/visualization/visual/effects.c b/modules/visualization/visual/effects.c
index d93efac..473cd41 100644
--- a/modules/visualization/visual/effects.c
+++ b/modules/visualization/visual/effects.c
@@ -386,7 +386,7 @@ int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
fft_state *p_state; /* internal FFT data */
int i , j , k;
- int i_line;
+ int i_line = 0;
int16_t p_dest[FFT_BUFFER_SIZE]; /* Adapted FFT result */
int16_t p_buffer1[FFT_BUFFER_SIZE]; /* Buffer on which we perform
the FFT (first channel) */
@@ -396,8 +396,6 @@ int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
int16_t *p_buffs; /* int16_t converted buffer */
int16_t *p_s16_buff; /* int16_t converted buffer */
- i_line = 0;
-
p_s16_buff = malloc( p_buffer->i_nb_samples * p_effect->i_nb_chans * sizeof(int16_t) );
if( !p_s16_buff )
return -1;
@@ -441,7 +439,6 @@ int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
height = malloc( i_nb_bands * sizeof(int) );
if( !height)
{
- free( p_effect->p_data );
free( p_s16_buff );
return -1;
}
@@ -463,7 +460,6 @@ int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
{
msg_Err(p_aout,"unable to initialize FFT transform");
free( height );
- free( p_effect->p_data );
free( p_s16_buff );
return -1;
}
More information about the vlc-devel
mailing list