From: Rémi Duraffort Date: Wed, 25 Mar 2009 14:27:45 +0000 (+0100) Subject: visual: check for NULL in the right place. X-Git-Tag: 1.0.0-pre2~388 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=44b96fd1ef535dd77380bceab1cc1d21b65e00b6;p=vlc visual: check for NULL in the right place. --- diff --git a/modules/visualization/visual/effects.c b/modules/visualization/visual/effects.c index 7eae6c95c5..7e70d71916 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 @@ -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; }