Skip to content

Commit

Permalink
avformat: fix memory leak on unhandled ES category
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
ssbssa authored and jbkempf committed Feb 26, 2016
1 parent 4076e83 commit 8c322e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/demux/avformat/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
}
}

p_input->p_sys = malloc( sizeof( int ) );
*((int *)p_input->p_sys) = p_sys->oc->nb_streams;

if( fmt->i_cat != VIDEO_ES && fmt->i_cat != AUDIO_ES)
{
msg_Warn( p_mux, "Unhandled ES category" );
return VLC_EGENERIC;
}

p_input->p_sys = malloc( sizeof( int ) );
*((int *)p_input->p_sys) = p_sys->oc->nb_streams;

stream = avformat_new_stream( p_sys->oc, NULL);
if( !stream )
{
Expand Down

0 comments on commit 8c322e4

Please sign in to comment.