Commit 2d824acd authored by Clément Stenac's avatar Clément Stenac

Fix duplicate definitions of FREE

parent c17969a0
......@@ -97,39 +97,34 @@ static __inline__ void en50221_MMIFree( en50221_mmi_object_t *p_object )
{
int i;
#define FREE( x ) \
if ( x != NULL ) \
free( x );
switch ( p_object->i_object_type )
{
case EN50221_MMI_ENQ:
FREE( p_object->u.enq.psz_text );
FREENULL( p_object->u.enq.psz_text );
break;
case EN50221_MMI_ANSW:
if ( p_object->u.answ.b_ok )
{
FREE( p_object->u.answ.psz_answ );
FREENULL( p_object->u.answ.psz_answ );
}
break;
case EN50221_MMI_MENU:
case EN50221_MMI_LIST:
FREE( p_object->u.menu.psz_title );
FREE( p_object->u.menu.psz_subtitle );
FREE( p_object->u.menu.psz_bottom );
FREENULL( p_object->u.menu.psz_title );
FREENULL( p_object->u.menu.psz_subtitle );
FREENULL( p_object->u.menu.psz_bottom );
for ( i = 0; i < p_object->u.menu.i_choices; i++ )
{
FREE( p_object->u.menu.ppsz_choices[i] );
FREENULL( p_object->u.menu.ppsz_choices[i] );
}
FREE( p_object->u.menu.ppsz_choices );
FREENULL( p_object->u.menu.ppsz_choices );
break;
default:
break;
}
#undef FREE
}
#define MAX_DEMUX 256
......
......@@ -77,10 +77,6 @@ static int HttpCallback( httpd_file_sys_t *p_args,
*****************************************************************************/
int E_(HTTPOpen)( access_t *p_access )
{
#define FREE( x ) \
if ( (x) != NULL ) \
free( x );
access_sys_t *p_sys = p_access->p_sys;
char *psz_address, *psz_cert = NULL, *psz_key = NULL,
*psz_ca = NULL, *psz_crl = NULL, *psz_user = NULL,
......@@ -196,8 +192,6 @@ int E_(HTTPOpen)( access_t *p_access )
p_sys->p_httpd_redir = httpd_RedirectNew( p_sys->p_httpd_host,
"/index.html", "/" );
#undef FREE
return VLC_SUCCESS;
}
......
......@@ -34,5 +34,3 @@ void E_( MMSTUClose ) ( access_t * );
/* mmsh */
int E_( MMSHOpen ) ( access_t * );
void E_( MMSHClose ) ( access_t * );
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
......@@ -912,14 +912,14 @@ static void MMSClose( access_t *p_access )
net_Close( p_sys->i_handle_udp );
}
FREE( p_sys->p_cmd );
FREE( p_sys->p_media );
FREE( p_sys->p_header );
FREE( p_sys->psz_server_version );
FREE( p_sys->psz_tool_version );
FREE( p_sys->psz_update_player_url );
FREE( p_sys->psz_encryption_type );
FREENULL( p_sys->p_cmd );
FREENULL( p_sys->p_media );
FREENULL( p_sys->p_header );
FREENULL( p_sys->psz_server_version );
FREENULL( p_sys->psz_tool_version );
FREENULL( p_sys->psz_update_player_url );
FREENULL( p_sys->psz_encryption_type );
}
/****************************************************************************
......@@ -1271,7 +1271,7 @@ static int mms_ParsePacket( access_t *p_access,
}
else
{
FREE( p_sys->p_media );
FREENULL( p_sys->p_media );
p_sys->p_media = p_packet;
p_sys->i_media = i_packet_length - 8;
p_sys->i_media_used = 0;
......
......@@ -44,8 +44,6 @@
#include "info.h"
#include "intf.h"
#define FREE_AND_NULL(ptr) free(ptr); ptr = NULL;
extern void VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track,
const vcdinfo_itemid_t *p_itemid );
......@@ -1002,14 +1000,14 @@ VCDClose ( vlc_object_t *p_this )
if( p_vcdplayer->p_input ) vlc_object_release( p_vcdplayer->p_input );
FREE_AND_NULL( p_vcdplayer->p_entries );
FREE_AND_NULL( p_vcdplayer->p_segments );
FREE_AND_NULL( p_vcdplayer->psz_source );
FREE_AND_NULL( p_vcdplayer->track );
FREE_AND_NULL( p_vcdplayer->segment );
FREE_AND_NULL( p_vcdplayer->entry );
FREE_AND_NULL( p_access->psz_demux );
FREE_AND_NULL( p_vcdplayer );
FREENULL( p_vcdplayer->p_entries );
FREENULL( p_vcdplayer->p_segments );
FREENULL( p_vcdplayer->psz_source );
FREENULL( p_vcdplayer->track );
FREENULL( p_vcdplayer->segment );
FREENULL( p_vcdplayer->entry );
FREENULL( p_access->psz_demux );
FREENULL( p_vcdplayer );
p_vcd_access = NULL;
}
......
......@@ -44,8 +44,6 @@
#include "vlc_httpd.h"
#define FREE( p ) if( p ) { free( p); (p) = NULL; }
#define DEFAULT_PORT 8080
#define DEFAULT_SSL_PORT 8443
......
......@@ -225,9 +225,6 @@ static void CloseDecoder( vlc_object_t *p_this )
#define GET4BYTES( p ) \
GetDWBE( p ); p+= 4;
#define FREE( p ) \
if( p ) free( p )
static void cinepak_LoadCodebook( cinepak_codebook_t *p_codebook,
uint8_t *p_data, int b_grayscale )
{
......
......@@ -32,9 +32,6 @@
#define ASF_DEBUG 1
#define FREE( p ) \
if( p ) {free( p ); p = NULL; }
#define GUID_FMT "0x%x-0x%x-0x%x-0x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
#define GUID_PRINT( guid ) \
(guid).v1, \
......@@ -243,7 +240,7 @@ static void ASF_FreeObject_Index( asf_object_t *p_obj )
{
asf_object_index_t *p_index = (asf_object_index_t*)p_obj;
FREE( p_index->index_entry );
FREENULL( p_index->index_entry );
}
static int ASF_ReadObject_file_properties( stream_t *s, asf_object_t *p_obj )
......@@ -485,7 +482,7 @@ static void ASF_FreeObject_header_extension( asf_object_t *p_obj )
asf_object_header_extension_t *p_he =
(asf_object_header_extension_t *)p_obj;
FREE( p_he->p_header_extension_data );
FREENULL( p_he->p_header_extension_data );
}
static int ASF_ReadObject_stream_properties( stream_t *s, asf_object_t *p_obj )
......@@ -554,8 +551,8 @@ static void ASF_FreeObject_stream_properties( asf_object_t *p_obj )
asf_object_stream_properties_t *p_sp =
(asf_object_stream_properties_t*)p_obj;
FREE( p_sp->p_type_specific_data );
FREE( p_sp->p_error_correction_data );
FREENULL( p_sp->p_type_specific_data );
FREENULL( p_sp->p_error_correction_data );
}
......@@ -658,12 +655,12 @@ static void ASF_FreeObject_codec_list( asf_object_t *p_obj )
for( i_codec = 0; i_codec < p_cl->i_codec_entries_count; i_codec++ )
{
#define codec p_cl->codec[i_codec]
FREE( codec.psz_name );
FREE( codec.psz_description );
FREE( codec.p_information );
FREENULL( codec.psz_name );
FREENULL( codec.psz_description );
FREENULL( codec.p_information );
#undef codec
}
FREE( p_cl->codec );
FREENULL( p_cl->codec );
}
/* Microsoft should go to hell. This time the length give number of bytes
......@@ -734,11 +731,11 @@ static void ASF_FreeObject_content_description( asf_object_t *p_obj)
asf_object_content_description_t *p_cd =
(asf_object_content_description_t *)p_obj;
FREE( p_cd->psz_title );
FREE( p_cd->psz_author );
FREE( p_cd->psz_copyright );
FREE( p_cd->psz_description );
FREE( p_cd->psz_rating );
FREENULL( p_cd->psz_title );
FREENULL( p_cd->psz_author );
FREENULL( p_cd->psz_copyright );
FREENULL( p_cd->psz_description );
FREENULL( p_cd->psz_rating );
}
/* Language list: */
......@@ -795,8 +792,8 @@ static void ASF_FreeObject_language_list( asf_object_t *p_obj)
int i;
for( i = 0; i < p_ll->i_language; i++ )
FREE( p_ll->ppsz_language[i] );
FREE( p_ll->ppsz_language );
FREENULL( p_ll->ppsz_language[i] );
FREENULL( p_ll->ppsz_language );
}
/* Stream bitrate properties */
......@@ -958,9 +955,9 @@ static void ASF_FreeObject_extended_stream_properties( asf_object_t *p_obj)
int i;
for( i = 0; i < p_esp->i_stream_name_count; i++ )
FREE( p_esp->ppsz_stream_name[i] );
FREE( p_esp->pi_stream_name_language );
FREE( p_esp->ppsz_stream_name );
FREENULL( p_esp->ppsz_stream_name[i] );
FREENULL( p_esp->pi_stream_name_language );
FREENULL( p_esp->ppsz_stream_name );
}
......@@ -1002,7 +999,7 @@ static void ASF_FreeObject_advanced_mutual_exclusion( asf_object_t *p_obj)
asf_object_advanced_mutual_exclusion_t *p_ae =
(asf_object_advanced_mutual_exclusion_t *)p_obj;
FREE( p_ae->pi_stream_number );
FREENULL( p_ae->pi_stream_number );
}
......@@ -1046,8 +1043,8 @@ static void ASF_FreeObject_stream_prioritization( asf_object_t *p_obj)
asf_object_stream_prioritization_t *p_sp =
(asf_object_stream_prioritization_t *)p_obj;
FREE( p_sp->pi_priority_stream_number );
FREE( p_sp->pi_priority_flag );
FREENULL( p_sp->pi_priority_stream_number );
FREENULL( p_sp->pi_priority_flag );
}
......@@ -1153,8 +1150,8 @@ static void ASF_FreeObject_extended_content_description( asf_object_t *p_obj)
for( i = 0; i < p_ec->i_count; i++ )
{
FREE( p_ec->ppsz_name[i] );
FREE( p_ec->ppsz_value[i] );
FREENULL( p_ec->ppsz_name[i] );
FREENULL( p_ec->ppsz_value[i] );
}
}
......
......@@ -80,7 +80,6 @@ static int Seek ( demux_t *, mtime_t, int );
static int Demux_Seekable ( demux_t * );
static int Demux_UnSeekable( demux_t * );
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
#define __ABS( x ) ( (x) < 0 ? (-(x)) : (x) )
typedef struct
......@@ -651,11 +650,11 @@ static void Close ( vlc_object_t * p_this )
{
if( p_sys->track[i] )
{
FREE( p_sys->track[i]->p_index );
FREENULL( p_sys->track[i]->p_index );
free( p_sys->track[i] );
}
}
FREE( p_sys->track );
FREENULL( p_sys->track );
AVI_ChunkFreeRoot( p_demux->s, &p_sys->ck_root );
vlc_meta_Delete( p_sys->meta );
......
......@@ -108,10 +108,6 @@
} \
return( i_code )
#define FREE( p ) \
if( p ) {free( p ); p = NULL; }
/* Some assumptions:
* The input method HAVE to be seekable
......@@ -376,7 +372,7 @@ static int MP4_ReadBox_ftyp( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_ftyp( MP4_Box_t *p_box )
{
FREE( p_box->data.p_ftyp->i_compatible_brands );
FREENULL( p_box->data.p_ftyp->i_compatible_brands );
}
......@@ -619,7 +615,7 @@ static int MP4_ReadBox_hdlr( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_hdlr( MP4_Box_t *p_box )
{
FREE( p_box->data.p_hdlr->psz_name );
FREENULL( p_box->data.p_hdlr->psz_name );
}
static int MP4_ReadBox_vmhd( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -708,7 +704,7 @@ static int MP4_ReadBox_url( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_url( MP4_Box_t *p_box )
{
FREE( p_box->data.p_url->psz_location )
FREENULL( p_box->data.p_url->psz_location )
}
static int MP4_ReadBox_urn( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -729,8 +725,8 @@ static int MP4_ReadBox_urn( stream_t *p_stream, MP4_Box_t *p_box )
}
static void MP4_FreeBox_urn( MP4_Box_t *p_box )
{
FREE( p_box->data.p_urn->psz_name );
FREE( p_box->data.p_urn->psz_location );
FREENULL( p_box->data.p_urn->psz_name );
FREENULL( p_box->data.p_urn->psz_location );
}
......@@ -783,8 +779,8 @@ static int MP4_ReadBox_stts( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_stts( MP4_Box_t *p_box )
{
FREE( p_box->data.p_stts->i_sample_count );
FREE( p_box->data.p_stts->i_sample_delta );
FREENULL( p_box->data.p_stts->i_sample_count );
FREENULL( p_box->data.p_stts->i_sample_delta );
}
static int MP4_ReadBox_ctts( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -817,8 +813,8 @@ static int MP4_ReadBox_ctts( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_ctts( MP4_Box_t *p_box )
{
FREE( p_box->data.p_ctts->i_sample_count );
FREE( p_box->data.p_ctts->i_sample_offset );
FREENULL( p_box->data.p_ctts->i_sample_count );
FREENULL( p_box->data.p_ctts->i_sample_offset );
}
static int MP4_ReadLengthDescriptor( uint8_t **pp_peek, int64_t *i_read )
......@@ -941,12 +937,12 @@ static int MP4_ReadBox_esds( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_esds( MP4_Box_t *p_box )
{
FREE( p_box->data.p_esds->es_descriptor.psz_URL );
FREENULL( p_box->data.p_esds->es_descriptor.psz_URL );
if( p_box->data.p_esds->es_descriptor.p_decConfigDescr )
{
FREE( p_box->data.p_esds->es_descriptor.p_decConfigDescr->p_decoder_specific_info );
FREENULL( p_box->data.p_esds->es_descriptor.p_decConfigDescr->p_decoder_specific_info );
}
FREE( p_box->data.p_esds->es_descriptor.p_decConfigDescr );
FREENULL( p_box->data.p_esds->es_descriptor.p_decConfigDescr );
}
static int MP4_ReadBox_avcC( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1033,14 +1029,14 @@ static void MP4_FreeBox_avcC( MP4_Box_t *p_box )
for( i = 0; i < p_avcC->i_sps; i++ )
{
FREE( p_avcC->sps[i] );
FREENULL( p_avcC->sps[i] );
}
for( i = 0; i < p_avcC->i_pps; i++ )
{
FREE( p_avcC->pps[i] );
FREENULL( p_avcC->pps[i] );
}
if( p_avcC->i_sps > 0 ) FREE( p_avcC->sps );
if( p_avcC->i_pps > 0 ) FREE( p_avcC->pps );
if( p_avcC->i_sps > 0 ) FREENULL( p_avcC->sps );
if( p_avcC->i_pps > 0 ) FREENULL( p_avcC->pps );
}
static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1192,7 +1188,7 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_sample_soun( MP4_Box_t *p_box )
{
FREE( p_box->data.p_sample_soun->p_qt_description );
FREENULL( p_box->data.p_sample_soun->p_qt_description );
if( p_box->i_type == FOURCC_drms )
{
......@@ -1271,7 +1267,7 @@ int MP4_ReadBox_sample_vide( stream_t *p_stream, MP4_Box_t *p_box )
void MP4_FreeBox_sample_vide( MP4_Box_t *p_box )
{
FREE( p_box->data.p_sample_vide->p_qt_image_description );
FREENULL( p_box->data.p_sample_vide->p_qt_image_description );
}
static int MP4_ReadBox_sample_mp4s( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1368,7 +1364,7 @@ static int MP4_ReadBox_sample_tx3g( stream_t *p_stream, MP4_Box_t *p_box )
/* We can't easily call it, and anyway ~ 20 bytes lost isn't a real problem */
static void MP4_FreeBox_sample_text( MP4_Box_t *p_box )
{
FREE( p_box->data.p_sample_text->psz_text_name );
FREENULL( p_box->data.p_sample_text->psz_text_name );
}
#endif
......@@ -1429,7 +1425,7 @@ static int MP4_ReadBox_stsz( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_stsz( MP4_Box_t *p_box )
{
FREE( p_box->data.p_stsz->i_entry_size );
FREENULL( p_box->data.p_stsz->i_entry_size );
}
static int MP4_ReadBox_stsc( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1466,9 +1462,9 @@ static int MP4_ReadBox_stsc( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_stsc( MP4_Box_t *p_box )
{
FREE( p_box->data.p_stsc->i_first_chunk );
FREE( p_box->data.p_stsc->i_samples_per_chunk );
FREE( p_box->data.p_stsc->i_sample_description_index );
FREENULL( p_box->data.p_stsc->i_first_chunk );
FREENULL( p_box->data.p_stsc->i_samples_per_chunk );
FREENULL( p_box->data.p_stsc->i_sample_description_index );
}
static int MP4_ReadBox_stco_co64( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1514,7 +1510,7 @@ static int MP4_ReadBox_stco_co64( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_stco_co64( MP4_Box_t *p_box )
{
FREE( p_box->data.p_co64->i_chunk_offset );
FREENULL( p_box->data.p_co64->i_chunk_offset );
}
static int MP4_ReadBox_stss( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1548,7 +1544,7 @@ static int MP4_ReadBox_stss( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_stss( MP4_Box_t *p_box )
{
FREE( p_box->data.p_stss->i_sample_number )
FREENULL( p_box->data.p_stss->i_sample_number )
}
static int MP4_ReadBox_stsh( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1585,8 +1581,8 @@ static int MP4_ReadBox_stsh( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_stsh( MP4_Box_t *p_box )
{
FREE( p_box->data.p_stsh->i_shadowed_sample_number )
FREE( p_box->data.p_stsh->i_sync_sample_number )
FREENULL( p_box->data.p_stsh->i_shadowed_sample_number )
FREENULL( p_box->data.p_stsh->i_sync_sample_number )
}
......@@ -1617,7 +1613,7 @@ static int MP4_ReadBox_stdp( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_stdp( MP4_Box_t *p_box )
{
FREE( p_box->data.p_stdp->i_priority )
FREENULL( p_box->data.p_stdp->i_priority )
}
static int MP4_ReadBox_padb( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1661,10 +1657,10 @@ static int MP4_ReadBox_padb( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_padb( MP4_Box_t *p_box )
{
FREE( p_box->data.p_padb->i_reserved1 );
FREE( p_box->data.p_padb->i_pad2 );
FREE( p_box->data.p_padb->i_reserved2 );
FREE( p_box->data.p_padb->i_pad1 );
FREENULL( p_box->data.p_padb->i_reserved1 );
FREENULL( p_box->data.p_padb->i_pad2 );
FREENULL( p_box->data.p_padb->i_reserved2 );
FREENULL( p_box->data.p_padb->i_pad1 );
}
static int MP4_ReadBox_elst( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1720,10 +1716,10 @@ static int MP4_ReadBox_elst( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_elst( MP4_Box_t *p_box )
{
FREE( p_box->data.p_elst->i_segment_duration );
FREE( p_box->data.p_elst->i_media_time );
FREE( p_box->data.p_elst->i_media_rate_integer );
FREE( p_box->data.p_elst->i_media_rate_fraction );
FREENULL( p_box->data.p_elst->i_segment_duration );
FREENULL( p_box->data.p_elst->i_media_time );
FREENULL( p_box->data.p_elst->i_media_rate_integer );
FREENULL( p_box->data.p_elst->i_media_rate_fraction );
}
static int MP4_ReadBox_cprt( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -1757,7 +1753,7 @@ static int MP4_ReadBox_cprt( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_cprt( MP4_Box_t *p_box )
{
FREE( p_box->data.p_cprt->psz_notice );
FREENULL( p_box->data.p_cprt->psz_notice );
}
......@@ -1804,7 +1800,7 @@ static int MP4_ReadBox_cmvd( stream_t *p_stream, MP4_Box_t *p_box )
}
static void MP4_FreeBox_cmvd( MP4_Box_t *p_box )
{
FREE( p_box->data.p_cmvd->p_data );
FREENULL( p_box->data.p_cmvd->p_data );
}
......@@ -1967,7 +1963,7 @@ static int MP4_ReadBox_rdrf( stream_t *p_stream, MP4_Box_t *p_box )
static void MP4_FreeBox_rdrf( MP4_Box_t *p_box )
{
FREE( p_box->data.p_rdrf->psz_ref )
FREENULL( p_box->data.p_rdrf->psz_ref )
}
......@@ -2105,7 +2101,7 @@ static int MP4_ReadBox_0xa9xxx( stream_t *p_stream, MP4_Box_t *p_box )
}
static void MP4_FreeBox_0xa9xxx( MP4_Box_t *p_box )
{
FREE( p_box->data.p_0xa9xxx->psz_text );
FREENULL( p_box->data.p_0xa9xxx->psz_text );
}
/* For generic */
......@@ -2606,7 +2602,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
if( !psz_path || !psz_path[0] )
{
FREE( psz_path );
FREENULL( psz_path );
*pp_result = NULL;
return;
}
......@@ -2623,7 +2619,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
// psz_path,psz_token,i_number );
if( !psz_token )
{
FREE( psz_token );
FREENULL( psz_token );
free( psz_fmt );
*pp_result = p_box;
return;
......@@ -2712,7 +2708,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
else
{
// fprintf( stderr, "Argg malformed token \"%s\"",psz_token );
FREE( psz_token );
FREENULL( psz_token );
free( psz_fmt );
*pp_result = NULL;
return;
......
......@@ -245,8 +245,6 @@ static inline int64_t MP4_GetMoviePTS(demux_sys_t *p_sys )
static vlc_bool_t FindItem( demux_t *p_demux, playlist_t *p_playlist,
playlist_item_t **pp_item );
#define FREE( p ) if( p ) { free( p ); (p) = NULL;}
/*****************************************************************************
* Open: check file and initializes MP4 structures
*****************************************************************************/
......@@ -879,7 +877,7 @@ static void Close ( vlc_object_t * p_this )
{
MP4_TrackDestroy( p_demux, &p_sys->track[i_track] );
}
FREE( p_sys->track );
FREENULL( p_sys->track );
free( p_sys );
}
......@@ -1904,18 +1902,18 @@ static void MP4_TrackDestroy( demux_t *p_demux, mp4_track_t *p_track )
{
if( p_track->chunk )
{
FREE(p_track->chunk[i_chunk].p_sample_count_dts);
FREE(p_track->chunk[i_chunk].p_sample_delta_dts );
FREENULL(p_track->chunk[i_chunk].p_sample_count_dts);
FREENULL(p_track->chunk[i_chunk].p_sample_delta_dts );
FREE(p_track->chunk[i_chunk].p_sample_count_pts);
FREE(p_track->chunk[i_chunk].p_sample_offset_pts );
FREENULL(p_track->chunk[i_chunk].p_sample_count_pts);
FREENULL(p_track->chunk[i_chunk].p_sample_offset_pts );
}
}
FREE( p_track->chunk );
FREENULL( p_track->chunk );
if( !p_track->i_sample_size )
{
FREE( p_track->p_sample_size );
FREENULL( p_track->p_sample_size );
}
}
......
......@@ -37,8 +37,6 @@
#include "playlist.h"
#include "vlc_meta.h"
#define FREE( p ) if( p ) { free( p ); (p) = NULL; }
struct demux_sys_t
{
char *psz_prefix;
......@@ -373,12 +371,12 @@ static int Demux( demux_t *p_demux )
continue;
}
/* cleanup entry */
FREE( psz_title_entry )
FREE( psz_base_entry )
FREE( psz_author_entry )
FREE( psz_copyright_entry )
FREE( psz_moreinfo_entry )
FREE( psz_abstract_entry )
FREENULL( psz_title_entry )
FREENULL( psz_base_entry )
FREENULL( psz_author_entry )
FREENULL( psz_copyright_entry )
FREENULL( psz_moreinfo_entry )