[vlc-devel] [RFC 20/38] demux/ogg: replaces usage of xmalloc

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


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

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 6bdb96d..a9c9b05 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -797,7 +797,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 return VLC_EGENERIC;
 
             *pi_int = p_sys->i_attachments;
-            *ppp_attach = xmalloc( sizeof(input_attachment_t*) * p_sys->i_attachments );
+            *ppp_attach = malloc( sizeof(input_attachment_t*) * p_sys->i_attachments );
+
+            if( unlikely( !*ppp_attach ) )
+                return VLC_ENOMEM;
+
             for( int i = 0; i < p_sys->i_attachments; i++ )
                 (*ppp_attach)[i] = vlc_input_attachment_Duplicate( p_sys->attachments[i] );
             return VLC_SUCCESS;
-- 
2.9.0



More information about the vlc-devel mailing list