[vlc-devel] [RFC 23/38] access/vcd: replaced usage of xmalloc

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


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

diff --git a/modules/access/vcd/vcd.c b/modules/access/vcd/vcd.c
index 27f2bb7..bbd4dfb 100644
--- a/modules/access/vcd/vcd.c
+++ b/modules/access/vcd/vcd.c
@@ -270,7 +270,11 @@ static int Control( access_t *p_access, int i_query, va_list args )
             *va_arg( args, int* ) = p_sys->i_titles;
 
             /* Duplicate title infos */
-            *ppp_title = xmalloc( sizeof(input_title_t *) * p_sys->i_titles );
+            *ppp_title = malloc( sizeof(input_title_t *) * p_sys->i_titles );
+
+            if( unlikely( !*ppp_title ) )
+                return VLC_ENOMEM;
+
             for( int i = 0; i < p_sys->i_titles; i++ )
                 (*ppp_title)[i] = vlc_input_title_New();
             break;
-- 
2.9.0



More information about the vlc-devel mailing list