[vlc-commits] codec: spudec: check malloc

Zhao Zhili git at videolan.org
Tue Jun 19 11:26:42 CEST 2018


vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Fri Jun  8 17:47:18 2018 +0800| [833187d4176c7331ca8bfef5bfd2463a20aa1dba] | committer: Thomas Guillem

codec: spudec: check malloc

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=833187d4176c7331ca8bfef5bfd2463a20aa1dba
---

 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 9e757cc7b6..ffa4e7a65b 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" );



More information about the vlc-commits mailing list