[vlc-commits] demux: avformat: remove xmalloc

Francois Cartegnie git at videolan.org
Mon Oct 30 22:19:41 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Oct 30 22:07:02 2017 +0100| [32b79a118cad2ab766f15a0283b24d078f36ad40] | committer: Francois Cartegnie

demux: avformat: remove xmalloc

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

 modules/demux/avformat/demux.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 03f5f16a01..8a948c0ed1 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -270,7 +270,12 @@ int OpenDemux( vlc_object_t *p_this )
     /* Fill p_demux fields */
     p_demux->pf_demux = Demux;
     p_demux->pf_control = Control;
-    p_demux->p_sys = p_sys = xmalloc( sizeof( demux_sys_t ) );
+    p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
+    if( !p_sys )
+    {
+        free( psz_url );
+        return VLC_ENOMEM;
+    }
     p_sys->ic = 0;
     p_sys->fmt = fmt;
     p_sys->tracks = NULL;



More information about the vlc-commits mailing list