[vlc-devel] [PATCH 1/1] lib: media_track: do not assert on empty tracklist in libvlc_media_tracklist_at
Martin Finkel
finkel2804 at gmail.com
Wed Apr 21 06:18:21 UTC 2021
From: Martin Finkel <martin at videolabs.io>
---
lib/media_track.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/media_track.c b/lib/media_track.c
index a11c2973c6..bc6f30dd98 100644
--- a/lib/media_track.c
+++ b/lib/media_track.c
@@ -286,6 +286,9 @@ libvlc_media_tracklist_count( const libvlc_media_tracklist_t *list )
libvlc_media_track_t *
libvlc_media_tracklist_at( libvlc_media_tracklist_t *list, size_t idx )
{
+ if( list == NULL || list->count == 0 )
+ return NULL;
+
assert( idx < list->count );
return &list->tracks[idx]->t;
}
--
2.20.1
More information about the vlc-devel
mailing list