Commit 92a52bb8 authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/asf/*: fixed mem leak.

* modules/demux/mp4/*: fixed segfault on close with some files.
parent c6ed526d
...@@ -668,6 +668,7 @@ static int DemuxInit( demux_t *p_demux ) ...@@ -668,6 +668,7 @@ static int DemuxInit( demux_t *p_demux )
tk->i_cat = AUDIO_ES; tk->i_cat = AUDIO_ES;
tk->p_es = es_out_Add( p_demux->out, &fmt ); tk->p_es = es_out_Add( p_demux->out, &fmt );
es_format_Clean( &fmt );
msg_Dbg( p_demux, "added new audio stream(codec:0x%x,ID:%d)", msg_Dbg( p_demux, "added new audio stream(codec:0x%x,ID:%d)",
GetWLE( p_data ), p_sp->i_stream_number ); GetWLE( p_data ), p_sp->i_stream_number );
...@@ -693,6 +694,7 @@ static int DemuxInit( demux_t *p_demux ) ...@@ -693,6 +694,7 @@ static int DemuxInit( demux_t *p_demux )
tk->i_cat = VIDEO_ES; tk->i_cat = VIDEO_ES;
tk->p_es = es_out_Add( p_demux->out, &fmt ); tk->p_es = es_out_Add( p_demux->out, &fmt );
es_format_Clean( &fmt );
msg_Dbg( p_demux, "added new video stream(ID:%d)", msg_Dbg( p_demux, "added new video stream(ID:%d)",
p_sp->i_stream_number ); p_sp->i_stream_number );
......
...@@ -1085,6 +1085,7 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1085,6 +1085,7 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
unsigned int i; unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_sample_soun_t ); MP4_READBOX_ENTER( MP4_Box_data_sample_soun_t );
p_box->data.p_sample_soun->p_qt_description = NULL;
/* Sanity check needed because the "wave" box does also contain an /* Sanity check needed because the "wave" box does also contain an
* "mp4a" box that we don't understand. */ * "mp4a" box that we don't understand. */
...@@ -1138,11 +1139,15 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1138,11 +1139,15 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->s, msg_Dbg( p_stream->s,
"read box: \"soun\" qt3+ sample/packet=%d bytes/packet=%d bytes/frame=%d bytes/sample=%d", "read box: \"soun\" qt3+ sample/packet=%d bytes/packet=%d "
p_box->data.p_sample_soun->i_sample_per_packet, p_box->data.p_sample_soun->i_bytes_per_packet, "bytes/frame=%d bytes/sample=%d",
p_box->data.p_sample_soun->i_bytes_per_frame, p_box->data.p_sample_soun->i_bytes_per_sample ); p_box->data.p_sample_soun->i_sample_per_packet,
p_box->data.p_sample_soun->i_bytes_per_packet,
p_box->data.p_sample_soun->i_bytes_per_frame,
p_box->data.p_sample_soun->i_bytes_per_sample );
#endif #endif
MP4_SeekStream( p_stream, p_box->i_pos + MP4_BOX_HEADERSIZE( p_box ) + 44 ); MP4_SeekStream( p_stream, p_box->i_pos +
MP4_BOX_HEADERSIZE( p_box ) + 44 );
} }
else else
{ {
...@@ -1151,8 +1156,10 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1151,8 +1156,10 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
p_box->data.p_sample_soun->i_bytes_per_frame = 0; p_box->data.p_sample_soun->i_bytes_per_frame = 0;
p_box->data.p_sample_soun->i_bytes_per_sample = 0; p_box->data.p_sample_soun->i_bytes_per_sample = 0;
msg_Dbg( p_stream->s, "read box: \"soun\" mp4 or qt1/2 (rest="I64Fd")", i_read ); msg_Dbg( p_stream->s, "read box: \"soun\" mp4 or qt1/2 (rest="I64Fd")",
MP4_SeekStream( p_stream, p_box->i_pos + MP4_BOX_HEADERSIZE( p_box ) + 28 ); i_read );
MP4_SeekStream( p_stream, p_box->i_pos +
MP4_BOX_HEADERSIZE( p_box ) + 28 );
} }
if( p_box->i_type == FOURCC_drms ) if( p_box->i_type == FOURCC_drms )
...@@ -1169,7 +1176,8 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1169,7 +1176,8 @@ static int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_ReadBoxContainerRaw( p_stream, p_box ); /* esds */ MP4_ReadBoxContainerRaw( p_stream, p_box ); /* esds */
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->s, "read box: \"soun\" in stsd channel %d sample size %d sampl rate %f", msg_Dbg( p_stream->s, "read box: \"soun\" in stsd channel %d "
"sample size %d sampl rate %f",
p_box->data.p_sample_soun->i_channelcount, p_box->data.p_sample_soun->i_channelcount,
p_box->data.p_sample_soun->i_samplesize, p_box->data.p_sample_soun->i_samplesize,
(float)p_box->data.p_sample_soun->i_sampleratehi + (float)p_box->data.p_sample_soun->i_sampleratehi +
......
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