[vlc-devel] [PATCH 14/25] packetizer:copy: fix unchecked memory allocation
Steve Lhomme
robux4 at videolabs.io
Mon Jul 10 16:52:18 CEST 2017
---
modules/packetizer/copy.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules/packetizer/copy.c b/modules/packetizer/copy.c
index b9ee6d107a..6d442d9e47 100644
--- a/modules/packetizer/copy.c
+++ b/modules/packetizer/copy.c
@@ -106,6 +106,9 @@ static int Open( vlc_object_t *p_this )
}
p_dec->p_sys = p_sys = malloc( sizeof(*p_sys) );
+ if (unlikely(p_sys == NULL))
+ return VLC_ENOMEM;
+
p_sys->p_block = NULL;
switch( p_dec->fmt_in.i_codec )
{
--
2.12.1
More information about the vlc-devel
mailing list