Commit 6339478f authored by Rémi Duraffort's avatar Rémi Duraffort

Another time : remove useless test before free().

parent bcddfd63
......@@ -209,9 +209,7 @@ static void CloseDecoder( vlc_object_t *p_this )
msg_Dbg( p_dec, "cinepak decoder stopped" );
for( i = 0; i < 3; i++ )
{
if( p_sys->context.p_pix[i] ) free( p_sys->context.p_pix[i] );
}
free( p_sys->context.p_pix[i] );
free( p_sys );
}
......
......@@ -291,10 +291,10 @@ static void ParseText( decoder_t *p_dec, block_t *p_block )
}
if( psz_subtitle ) free( psz_subtitle );
if( psz_cmml ) free( psz_cmml );
if( p_anchor ) free( p_anchor );
if( p_clip_parser ) free( p_clip_parser );
if( psz_url ) free( psz_url );
free( psz_subtitle );
free( psz_cmml );
free( p_anchor );
free( p_clip_parser );
free( psz_url );
}
......@@ -133,7 +133,7 @@ static void FreeFrameBuffer( dirac_decoder_t *p_dirac )
int i;
for( i = 0; i < 3; i++ )
{
if( p_dirac->fbuf->buf[i] ) free( p_dirac->fbuf->buf[i] );
free( p_dirac->fbuf->buf[i] );
p_dirac->fbuf->buf[i] = 0;
}
}
......
......@@ -556,8 +556,8 @@ static int DecOpen( vlc_object_t *p_this )
else
date_Init( &p_sys->end_date, 25 /* FIXME */, 1 );
if( p_vih ) free( p_vih );
if( p_wf ) free( p_wf );
free( p_vih );
free( p_wf );
return VLC_SUCCESS;
......@@ -573,9 +573,9 @@ static int DecOpen( vlc_object_t *p_this )
CoUninitialize();
#endif /* LOADER */
if( p_vih ) free( p_vih );
if( p_wf ) free( p_wf );
if( p_sys ) free( p_sys );
free( p_vih );
free( p_wf );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -771,7 +771,7 @@ void DecoderClose( vlc_object_t *p_this )
CoUninitialize();
#endif
if( p_sys->p_buffer ) free( p_sys->p_buffer );
free( p_sys->p_buffer );
free( p_sys );
}
......@@ -1400,7 +1400,7 @@ static int EncOpen( vlc_object_t *p_this )
CoUninitialize();
#endif /* LOADER */
if( p_sys ) free( p_sys );
free( p_sys );
return VLC_EGENERIC;
}
......
......@@ -870,7 +870,6 @@ static void decode_region_composition( decoder_t *p_dec, bs_t *s )
while( p_region->i_object_defs )
{
int i = p_region->i_object_defs - 1;
if( p_region->p_object_defs[i].psz_text )
free( p_region->p_object_defs[i].psz_text );
if( !i )
free( p_region->p_object_defs );
......@@ -999,7 +998,7 @@ static void decode_display_definition( decoder_t *p_dec, bs_t *s )
}
p_sys->p_display = p_display;
if( p_old ) free( p_old );
free( p_old );
if( i_processed_length != i_segment_length*8 )
{
......@@ -1413,7 +1412,7 @@ static void free_all( decoder_t *p_dec )
dvbsub_region_t *p_reg, *p_reg_next;
dvbsub_clut_t *p_clut, *p_clut_next;
if( p_sys->p_display ) free( p_sys->p_display );
free( p_sys->p_display );
for( p_clut = p_sys->p_cluts; p_clut != NULL; p_clut = p_clut_next )
{
......@@ -1428,10 +1427,9 @@ static void free_all( decoder_t *p_dec )
p_reg_next = p_reg->p_next;
for( i = 0; i < p_reg->i_object_defs; i++ )
if( p_reg->p_object_defs[i].psz_text )
free( p_reg->p_object_defs[i].psz_text );
if( p_reg->i_object_defs ) free( p_reg->p_object_defs );
if( p_reg->p_pixbuf ) free( p_reg->p_pixbuf );
free( p_reg->p_pixbuf );
free( p_reg );
}
p_sys->p_regions = NULL;
......
......@@ -344,5 +344,5 @@ void E_(EndAudioDec)( decoder_t *p_dec )
{
decoder_sys_t *p_sys = p_dec->p_sys;
if( p_sys->p_output ) free( p_sys->p_output );
free( p_sys->p_output );
}
......@@ -224,7 +224,7 @@ struct filter_owner_sys_t
static void PictureRelease( picture_t *p_pic )
{
if( p_pic->p_data_orig ) free( p_pic->p_data_orig );
free( p_pic->p_data_orig );
}
static picture_t *video_new_buffer_filter( filter_t *p_filter )
......
......@@ -280,7 +280,7 @@ void E_(CloseDemux)( vlc_object_t *p_this )
if( p_sys->ic ) av_close_input_file( p_sys->ic );
if( !b_avfmt_nofile ) p_sys->fmt->flags ^= AVFMT_NOFILE;
if( p_sys->io_buffer ) free( p_sys->io_buffer );
free( p_sys->io_buffer );
free( p_sys );
}
......
......@@ -350,7 +350,9 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
else
p_sys->i_hq = FF_MB_DECISION_RD;
}
if( val.psz_string ) free( val.psz_string );
else
p_sys->i_hq = FF_MB_DECISION_RD;
free( val.psz_string );
var_Get( p_enc, ENC_CFG_PREFIX "qmin", &val );
p_sys->i_qmin = val.i_int;
......@@ -1084,8 +1086,8 @@ void E_(CloseEncoder)( vlc_object_t *p_this )
vlc_mutex_unlock( lock );
av_free( p_sys->p_context );
if( p_sys->p_buffer ) free( p_sys->p_buffer );
if( p_sys->p_buffer_out ) free( p_sys->p_buffer_out );
free( p_sys->p_buffer );
free( p_sys->p_buffer_out );
free( p_sys );
}
......@@ -214,7 +214,7 @@ void E_(ClosePostproc)( decoder_t *p_dec, void *p_data )
var_DelCallback( p_dec, "ffmpeg-pp-q", PPQCallback, p_sys );
if( p_sys ) free( p_sys );
free( p_sys );
}
/*****************************************************************************
......
......@@ -316,7 +316,7 @@ static void CloseDecoder( vlc_object_t *p_this )
FLAC__stream_decoder_delete( p_sys->p_flac );
#endif
if( p_sys->p_block ) free( p_sys->p_block );
free( p_sys->p_block );
free( p_sys );
}
......@@ -1337,7 +1337,7 @@ static void CloseEncoder( vlc_object_t *p_this )
FLAC__stream_encoder_delete( p_sys->p_flac );
if( p_sys->p_buffer ) free( p_sys->p_buffer );
free( p_sys->p_buffer );
free( p_sys );
}
......
......@@ -234,7 +234,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
error:
if( p_row_pointers ) free( p_row_pointers );
free( p_row_pointers );
png_destroy_read_struct( &p_png, &p_info, &p_end_info );
block_Release( p_block ); *pp_block = NULL;
return NULL;
......
......@@ -329,7 +329,7 @@ static void Close( vlc_object_t *p_this )
vlc_mutex_unlock( lock );
if( p_sys ) free( p_sys );
free( p_sys );
}
/*****************************************************************************
......
......@@ -248,7 +248,7 @@ static void Close( vlc_object_t *p_this )
decoder_t *p_dec = (decoder_t*)p_this;
CloseDll( p_dec );
if( p_dec->p_sys->p_out ) free( p_dec->p_sys->p_out );
free( p_dec->p_sys->p_out );
free( p_dec->p_sys );
}
......
......@@ -804,7 +804,7 @@ static void CloseDecoder( vlc_object_t *p_this )
speex_bits_destroy( &p_sys->bits );
}
if( p_sys->p_header ) free( p_sys->p_header );
free( p_sys->p_header );
free( p_sys );
}
......@@ -1031,6 +1031,6 @@ static void CloseEncoder( vlc_object_t *p_this )
speex_encoder_destroy( p_sys->p_state );
speex_bits_destroy( &p_sys->bits );
if( p_sys->p_buffer ) free( p_sys->p_buffer );
free( p_sys->p_buffer );
free( p_sys );
}
......@@ -121,7 +121,7 @@ void ParseSSAString( decoder_t *p_dec,
if( !strcmp( p_sys->pp_ssa_styles[i]->psz_stylename, psz_style ) )
p_style = p_sys->pp_ssa_styles[i];
}
if( psz_style ) free( psz_style );
free( psz_style );
p_spu->p_region->psz_text = psz_new_subtitle;
if( p_style == NULL )
......@@ -353,7 +353,7 @@ void ParseSSAHeader( decoder_t *p_dec )
}
eof:
if( psz_header ) free( psz_header );
free( psz_header );
return;
}
......
......@@ -283,11 +283,8 @@ static void CloseDecoder( vlc_object_t *p_this )
if( !p_sys->pp_ssa_styles[i] )
continue;
if( p_sys->pp_ssa_styles[i]->psz_stylename )
free( p_sys->pp_ssa_styles[i]->psz_stylename );
if( p_sys->pp_ssa_styles[i]->font_style.psz_fontname )
free( p_sys->pp_ssa_styles[i]->font_style.psz_fontname );
if( p_sys->pp_ssa_styles[i] )
free( p_sys->pp_ssa_styles[i] );
}
TAB_CLEAN( p_sys->i_ssa_styles, p_sys->pp_ssa_styles );
......@@ -302,7 +299,6 @@ static void CloseDecoder( vlc_object_t *p_this )
if( p_sys->pp_images[i]->p_pic )
p_sys->pp_images[i]->p_pic->pf_release( p_sys->pp_images[i]->p_pic );
if( p_sys->pp_images[i]->psz_filename )
free( p_sys->pp_images[i]->psz_filename );
free( p_sys->pp_images[i] );
......@@ -401,7 +397,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
if( !p_spu )
{
msg_Warn( p_dec, "can't get spu buffer" );
if( psz_subtitle ) free( psz_subtitle );
free( psz_subtitle );
return NULL;
}
......@@ -417,7 +413,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
if( !p_spu->p_region )
{
msg_Err( p_dec, "cannot allocate SPU region" );
if( psz_subtitle ) free( psz_subtitle );
free( psz_subtitle );
p_dec->pf_spu_buffer_del( p_dec, p_spu );
return NULL;
}
......@@ -456,7 +452,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
p_spu->i_original_picture_width = p_sys->i_original_width;
p_spu->i_original_picture_height = p_sys->i_original_height;
}
if( psz_subtitle ) free( psz_subtitle );
free( psz_subtitle );
return p_spu;
}
......
......@@ -945,7 +945,7 @@ static int Open ( vlc_object_t *p_this )
p_sys->param.analyse.i_me_method = X264_ME_TESA;
}
#endif
if( val.psz_string ) free( val.psz_string );
free( val.psz_string );
var_Get( p_enc, SOUT_CFG_PREFIX "merange", &val );
if( val.i_int >= 0 && val.i_int <= 64 )
......@@ -979,7 +979,7 @@ static int Open ( vlc_object_t *p_this )
p_sys->param.analyse.i_direct_mv_pred = X264_DIRECT_PRED_AUTO;
}
#endif
if( val.psz_string ) free( val.psz_string );
free( val.psz_string );
var_Get( p_enc, SOUT_CFG_PREFIX "psnr", &val );
p_sys->param.analyse.b_psnr = val.b_bool;
......@@ -1121,7 +1121,7 @@ static int Open ( vlc_object_t *p_this )
p_sys->param.analyse.inter |= X264_ANALYSE_I8x8;
#endif
}
if( val.psz_string ) free( val.psz_string );
free( val.psz_string );
#if X264_BUILD >= 30
var_Get( p_enc, SOUT_CFG_PREFIX "8x8dct", &val );
......@@ -1343,7 +1343,6 @@ static void Close( vlc_object_t *p_this )
encoder_t *p_enc = (encoder_t *)p_this;
encoder_sys_t *p_sys = p_enc->p_sys;
if( p_sys->psz_stat_name )
free( p_sys->psz_stat_name );
x264_encoder_close( p_sys->h );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment