[vlc-devel] [RFC 12/38] demux/avformat: removed usage of xcalloc

Filip Roséen filip at videolabs.io
Mon Jun 27 13:43:23 CEST 2016


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

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 8ef3db8..a00b3e4 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -632,7 +632,13 @@ int OpenDemux( vlc_object_t *p_this )
         }
         TAB_APPEND( p_sys->i_tk, p_sys->tk, es );
     }
-    p_sys->tk_pcr = xcalloc( p_sys->i_tk, sizeof(*p_sys->tk_pcr) );
+    p_sys->tk_pcr = calloc( p_sys->i_tk, sizeof(*p_sys->tk_pcr) );
+
+    if( unlikely( !p_sys->tk_pcr ) )
+    {
+        CloseDemux( p_sys );
+        return VLC_ENOMEM;
+    }
 
     if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
         i_start_time = p_sys->ic->start_time * 1000000 / AV_TIME_BASE;
-- 
2.9.0



More information about the vlc-devel mailing list