Commit 30cfbde3 authored by Rafaël Carré's avatar Rafaël Carré

mp4 demux: fix crash

Don't call with NULL
Remove unused return value
parent e40fcf32
...@@ -2663,7 +2663,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track, ...@@ -2663,7 +2663,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
#endif #endif
} }
static int FreeAndResetChunk( mp4_chunk_t *ck ) static void FreeAndResetChunk( mp4_chunk_t *ck )
{ {
free( ck->p_sample_count_dts ); free( ck->p_sample_count_dts );
free( ck->p_sample_delta_dts ); free( ck->p_sample_delta_dts );
...@@ -2674,7 +2674,6 @@ static int FreeAndResetChunk( mp4_chunk_t *ck ) ...@@ -2674,7 +2674,6 @@ static int FreeAndResetChunk( mp4_chunk_t *ck )
free( ck->p_sample_data[i] ); free( ck->p_sample_data[i] );
free( ck->p_sample_data ); free( ck->p_sample_data );
memset( ck, 0, sizeof( mp4_chunk_t ) ); memset( ck, 0, sizeof( mp4_chunk_t ) );
return VLC_SUCCESS;
} }
/**************************************************************************** /****************************************************************************
...@@ -2704,8 +2703,10 @@ static void MP4_TrackDestroy( mp4_track_t *p_track ) ...@@ -2704,8 +2703,10 @@ static void MP4_TrackDestroy( mp4_track_t *p_track )
} }
} }
FREENULL( p_track->chunk ); FREENULL( p_track->chunk );
if( p_track->cchunk ) {
FreeAndResetChunk( p_track->cchunk ); FreeAndResetChunk( p_track->cchunk );
FREENULL( p_track->cchunk ); FREENULL( p_track->cchunk );
}
if( !p_track->i_sample_size ) if( !p_track->i_sample_size )
{ {
......
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