Commit bee1e640 authored by Laurent Aimar's avatar Laurent Aimar

Fixed potential memleaks in avformat wrapper.

parent db449895
...@@ -508,12 +508,18 @@ static int Demux( demux_t *p_demux ) ...@@ -508,12 +508,18 @@ static int Demux( demux_t *p_demux )
{ {
p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ ); p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ );
if( !p_frame ) if( !p_frame )
{
av_free_packet( &pkt );
return 1; return 1;
} }
}
else else
{ {
if( ( p_frame = block_New( p_demux, pkt.size ) ) == NULL ) if( ( p_frame = block_New( p_demux, pkt.size ) ) == NULL )
{
av_free_packet( &pkt );
return 0; return 0;
}
memcpy( p_frame->p_buffer, pkt.data, pkt.size ); memcpy( p_frame->p_buffer, pkt.data, pkt.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