[vlc-devel] [RFC 21/38] packetizer/mpeg4video: replaced usage of xmalloc

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


---
 modules/packetizer/mpeg4video.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c
index bf8b864..e1ce505 100644
--- a/modules/packetizer/mpeg4video.c
+++ b/modules/packetizer/mpeg4video.c
@@ -160,7 +160,14 @@ static int Open( vlc_object_t *p_this )
     {
         /* We have a vol */
         p_dec->fmt_out.i_extra = p_dec->fmt_in.i_extra;
-        p_dec->fmt_out.p_extra = xmalloc( p_dec->fmt_in.i_extra );
+        p_dec->fmt_out.p_extra = malloc( p_dec->fmt_in.i_extra );
+
+        if( unlikely( !p_dec->fmt_out.p_extra ) )
+        {
+            free( p_sys );
+            return VLC_ENOMEM;
+        }
+
         memcpy( p_dec->fmt_out.p_extra, p_dec->fmt_in.p_extra,
                 p_dec->fmt_in.i_extra );
 
-- 
2.9.0



More information about the vlc-devel mailing list