libvlc_media_descriptor_t * p_md;
- if( index < 0 || index > vlc_array_count( &p_mlist->items ))
+ if( index < 0 || index >= vlc_array_count( &p_mlist->items ))
{
libvlc_exception_raise( p_e, "Index out of bounds exception");
return;
{
VLC_UNUSED(p_e);
+ if( index < 0 || index >= vlc_array_count( &p_mlist->items ))
+ {
+ libvlc_exception_raise( p_e, "Index out of bounds exception");
+ return NULL;
+ }
+
libvlc_media_descriptor_t * p_md;
p_md = vlc_array_item_at_index( &p_mlist->items, index );
libvlc_media_descriptor_retain( p_md );