]> git.sesse.net Git - vlc/commitdiff
visual: check for NULL in the right place.
authorRémi Duraffort <ivoire@videolan.org>
Wed, 25 Mar 2009 14:27:45 +0000 (15:27 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 25 Mar 2009 14:28:26 +0000 (15:28 +0100)
modules/visualization/visual/effects.c

index 7eae6c95c59d8068e0dd421c81ee09daff31709d..7e70d71916402c00f7e7f8692b0962f64eb047b5 100644 (file)
@@ -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@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;
     }