Commit b7235d6e authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Jean-Paul Saman

Check malloc() return value.

parent 1da96fec
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* subtitle.c: Demux for subtitle text files. * subtitle.c: Demux for subtitle text files.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2004 the VideoLAN team * Copyright (C) 1999-2004 the VideoLAN team
* $Id$ * $Id: 6990562ea05f756333a9a79d2d41a4dcc407331c $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org> * Derk-Jan Hartman <hartman at videolan dot org>
...@@ -189,6 +189,11 @@ static int Open ( vlc_object_t *p_this ) ...@@ -189,6 +189,11 @@ static int Open ( vlc_object_t *p_this )
p_demux->pf_demux = Demux; p_demux->pf_demux = Demux;
p_demux->pf_control = Control; p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
if( !p_sys )
{
msg_Err( p_demux, "out of memory" );
return VLC_ENOMEM;
}
p_sys->psz_header = NULL; p_sys->psz_header = NULL;
p_sys->i_subtitle = 0; p_sys->i_subtitle = 0;
p_sys->i_subtitles = 0; p_sys->i_subtitles = 0;
...@@ -1301,4 +1306,3 @@ static int ParseDVDSubtitle( demux_t *p_demux, subtitle_t *p_subtitle ) ...@@ -1301,4 +1306,3 @@ static int ParseDVDSubtitle( demux_t *p_demux, subtitle_t *p_subtitle )
} }
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment