[vlc-commits] mux:asf: fix unchecked memory allocation

Steve Lhomme git at videolan.org
Wed Jul 12 12:22:51 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon Jul 10 13:40:50 2017 +0200| [89c4c011f4544e8044052955bef3758195945b1a] | committer: Jean-Baptiste Kempf

mux:asf: fix unchecked memory allocation

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

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

 modules/mux/asf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index 15890e59b9..8fb7e67aa0 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -346,6 +346,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     }
 
     tk = p_input->p_sys = malloc( sizeof( asf_track_t ) );
+    if( unlikely(p_input->p_sys == NULL) )
+        return VLC_ENOMEM;
     memset( tk, 0, sizeof( *tk ) );
     tk->i_cat = p_input->p_fmt->i_cat;
     tk->i_sequence = 0;



More information about the vlc-commits mailing list