[vlc-commits] avformat: fix memory leak on unhandled ES category

Hannes Domani git at videolan.org
Fri Feb 26 18:02:04 CET 2016


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Fri Feb 26 17:49:18 2016 +0100| [8c322e4bae35d8d4d5cc6d6670828f8159b097aa] | committer: Jean-Baptiste Kempf

avformat: fix memory leak on unhandled ES category

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8c322e4bae35d8d4d5cc6d6670828f8159b097aa
---

 modules/demux/avformat/mux.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index da00d3e..bf53abd 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -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 )
     {



More information about the vlc-commits mailing list