[vlc-commits] [Git][videolan/vlc][master] media_track: fix tracklist leak when no track found

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Mar 11 16:49:26 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
656e5eb2 by Steve Lhomme at 2023-03-11T16:32:00+00:00
media_track: fix tracklist leak when no track found

When count is 0 the list is still allocated. Either we should not allocate
one, we free it locally, or we pass it on as it.
The latter is similar to the code from 40c14fbee48975100aaa92b83a99ac33fa086933
in libvlc_media_tracklist_from_es_array().

Introduced in 057f3ef9e8b6bef1db79c1824daf667f4e777283.

- - - - -


1 changed file:

- lib/media_track.c


Changes:

=====================================
lib/media_track.c
=====================================
@@ -270,7 +270,7 @@ libvlc_media_tracklist_from_player( vlc_player_t *player,
     libvlc_media_tracklist_t *list = libvlc_media_tracklist_alloc( count );
 
     if( count == 0 || list == NULL )
-        return NULL;
+        return list;
 
     for( size_t i = 0; i < count; ++i )
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/656e5eb27ab1584e66efa7d132fd3b272165fbde

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/656e5eb27ab1584e66efa7d132fd3b272165fbde
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list