Commit 908e255b authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fix potential crash condition.

parent 3eba2b7d
...@@ -227,7 +227,12 @@ libvlc_input_t * libvlc_playlist_get_input( libvlc_instance_t *p_instance, ...@@ -227,7 +227,12 @@ libvlc_input_t * libvlc_playlist_get_input( libvlc_instance_t *p_instance,
return NULL; return NULL;
} }
p_input = (libvlc_input_t *)malloc( sizeof( libvlc_input_t ) ); p_input = (libvlc_input_t *)malloc( sizeof( libvlc_input_t ) );
if( !p_input )
{
libvlc_exception_raise( p_e, "out of memory" );
vlc_mutex_unlock( &p_instance->p_playlist->object_lock );
return NULL;
}
p_input->i_input_id = PL->p_input->i_object_id; p_input->i_input_id = PL->p_input->i_object_id;
p_input->p_instance = p_instance; p_input->p_instance = p_instance;
vlc_mutex_unlock( &PL->object_lock ); vlc_mutex_unlock( &PL->object_lock );
......
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