Commit aed6c00e authored by Jean-Paul Saman's avatar Jean-Paul Saman

check malloc return value.

parent 77f30734
...@@ -125,10 +125,9 @@ libvlc_media_list_new( libvlc_instance_t * p_inst, ...@@ -125,10 +125,9 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
libvlc_media_list_t * p_mlist; libvlc_media_list_t * p_mlist;
p_mlist = malloc(sizeof(libvlc_media_list_t)); p_mlist = malloc(sizeof(libvlc_media_list_t));
if( !p_mlist ) if( !p_mlist )
return NULL; return NULL;
p_mlist->p_libvlc_instance = p_inst; p_mlist->p_libvlc_instance = p_inst;
p_mlist->p_event_manager = libvlc_event_manager_new( p_mlist, p_inst, p_e ); p_mlist->p_event_manager = libvlc_event_manager_new( p_mlist, p_inst, p_e );
...@@ -153,7 +152,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst, ...@@ -153,7 +152,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
} }
vlc_mutex_init( &p_mlist->object_lock ); vlc_mutex_init( &p_mlist->object_lock );
vlc_array_init( &p_mlist->items ); vlc_array_init( &p_mlist->items );
p_mlist->i_refcount = 1; p_mlist->i_refcount = 1;
p_mlist->p_md = NULL; p_mlist->p_md = NULL;
...@@ -405,7 +404,7 @@ void _libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist, ...@@ -405,7 +404,7 @@ void _libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist,
libvlc_exception_raise( p_e, "Index out of bounds exception"); libvlc_exception_raise( p_e, "Index out of bounds exception");
return; return;
} }
p_md = vlc_array_item_at_index( &p_mlist->items, index ); p_md = vlc_array_item_at_index( &p_mlist->items, index );
notify_item_deletion( p_mlist, p_md, index, EventWillHappen ); notify_item_deletion( p_mlist, p_md, index, EventWillHappen );
......
...@@ -261,6 +261,9 @@ libvlc_media_list_player_new( libvlc_instance_t * p_instance, ...@@ -261,6 +261,9 @@ libvlc_media_list_player_new( libvlc_instance_t * p_instance,
(void)p_e; (void)p_e;
libvlc_media_list_player_t * p_mlp; libvlc_media_list_player_t * p_mlp;
p_mlp = malloc(sizeof(libvlc_media_list_player_t)); p_mlp = malloc(sizeof(libvlc_media_list_player_t));
if( !p_mlp )
return NULL;
p_mlp->current_playing_item_path = NULL; p_mlp->current_playing_item_path = NULL;
p_mlp->p_mi = NULL; p_mlp->p_mi = NULL;
p_mlp->p_mlist = NULL; p_mlp->p_mlist = NULL;
...@@ -316,7 +319,7 @@ void libvlc_media_list_player_set_media_list( ...@@ -316,7 +319,7 @@ void libvlc_media_list_player_set_media_list(
libvlc_exception_t * p_e ) libvlc_exception_t * p_e )
{ {
vlc_mutex_lock( &p_mlp->object_lock ); vlc_mutex_lock( &p_mlp->object_lock );
if( libvlc_media_list_player_is_playing( p_mlp, p_e ) ) if( libvlc_media_list_player_is_playing( p_mlp, p_e ) )
{ {
libvlc_media_player_stop( p_mlp->p_mi, p_e ); libvlc_media_player_stop( p_mlp->p_mi, p_e );
......
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