[vlc-devel] [PATCH] avformat: check malloc() result

Hannes Domani ssbssa at yahoo.de
Fri Feb 26 18:21:52 CET 2016


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

diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index bf53abd..b5c86a5 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -210,6 +210,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     }
 
     p_input->p_sys = malloc( sizeof( int ) );
+    if( unlikely(p_input->p_sys == NULL) )
+        return VLC_ENOMEM;
+
     *((int *)p_input->p_sys) = p_sys->oc->nb_streams;
 
     stream = avformat_new_stream( p_sys->oc, NULL);
-- 
2.7.1



More information about the vlc-devel mailing list