[vlc-devel] [V2 12/14] codec: spudec: check malloc

Zhao Zhili quinkblack at foxmail.com
Fri Jun 8 11:47:18 CEST 2018


---
 modules/codec/spudec/spudec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/spudec/spudec.c b/modules/codec/spudec/spudec.c
index 9e757cc..ffa4e7a 100644
--- a/modules/codec/spudec/spudec.c
+++ b/modules/codec/spudec/spudec.c
@@ -78,6 +78,8 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
         return VLC_EGENERIC;
 
     p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     p_sys->b_packetizer = b_packetizer;
     p_sys->b_disabletrans = var_InheritBool( p_dec, "dvdsub-transparency" );
-- 
2.9.5





More information about the vlc-devel mailing list