[vlc-devel] commit: visual: check for NULL in the right place. ( Rémi Duraffort )

git version control git at videolan.org
Wed Mar 25 15:48:48 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Mar 25 15:27:45 2009 +0100| [44b96fd1ef535dd77380bceab1cc1d21b65e00b6] | committer: Rémi Duraffort 

visual: check for NULL in the right place.

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

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

diff --git a/modules/visualization/visual/effects.c b/modules/visualization/visual/effects.c
index 7eae6c9..7e70d71 100644
--- a/modules/visualization/visual/effects.c
+++ b/modules/visualization/visual/effects.c
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * effects.c : Effects for the visualization system
  *****************************************************************************
- * Copyright (C) 2002 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Clément Stenac <zorglub at via.ecp.fr>
@@ -124,15 +124,15 @@ int spectrum_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
     if( !p_data )
     {
         p_effect->p_data = p_data = malloc( sizeof( spectrum_data ) );
-
-        p_data->peaks = calloc( 80, sizeof(int) );
-        p_data->prev_heights = calloc( 80, sizeof(int) );
-
-        if( !p_data)
+        if( !p_data )
         {
             free( p_s16_buff );
             return -1;
         }
+
+        p_data->peaks = calloc( 80, sizeof(int) );
+        p_data->prev_heights = calloc( 80, sizeof(int) );
+
         peaks = ( int * )p_data->peaks;
         prev_heights = ( int * )p_data->prev_heights;
     }




More information about the vlc-devel mailing list