[vlc-devel] commit: Check malloc return value. ( Rémi Duraffort )

git version control git at videolan.org
Tue Mar 11 23:04:29 CET 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Mar 11 20:42:28 2008 +0100| [da686e46efe4a3085c7aa9286e0b2d55dbd1e918]

Check malloc return value.

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

 modules/demux/rawvid.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c
index 9a9b0e5..add4213 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -165,6 +165,9 @@ static int Open( vlc_object_t * p_this )
     p_demux->pf_demux   = Demux;
     p_demux->pf_control = Control;
     p_demux->p_sys      = p_sys = malloc( sizeof( demux_sys_t ) );
+    if( !p_sys )
+        return VLC_EGENERIC;
+
     p_sys->i_pcr = 1;
 
     p_sys->b_y4m = b_y4m;




More information about the vlc-devel mailing list