Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
78a68664 by Alaric Senat at 2024-04-11T08:41:48+00:00
medialibrary: fix a playlist mrl leak

The condition was flawed. `strdup_helper` allocation success made the
condition pass to the `else` statement, thus erasing the previously
allocated value and causing a leak.

This patch reworks the condition to properly succeed when the string
duplication is done.

- - - - -
79df34a5 by Alaric Senat at 2024-04-11T08:41:48+00:00
medialibrary: bind wrapped `favoriteOnly`

This was forgotten in 9394e7eace4f7a343cf0a9de8ef63f2108b515ef.

- - - - -


2 changed files:

- modules/misc/medialibrary/entities.cpp
- modules/misc/medialibrary/medialibrary.cpp


Changes:

=====================================
modules/misc/medialibrary/entities.cpp
=====================================
@@ -469,12 +469,13 @@ bool Convert( const medialibrary::IPlaylist* input, 
vlc_ml_playlist_t& output )
         return false;
 
     // NOTE: mrl() must only be called when isReadOnly() is true.
-    if( output.b_is_read_only && !strdup_helper( input->mrl(), output.psz_mrl 
) )
-        return false;
-    else
+    if (!output.b_is_read_only)
+    {
         output.psz_mrl = nullptr;
+        return true;
+    }
 
-    return true;
+    return strdup_helper(input->mrl(), output.psz_mrl) == true;
 }
 
 bool Convert( const medialibrary::IFolder* input, vlc_ml_folder_t& output )


=====================================
modules/misc/medialibrary/medialibrary.cpp
=====================================
@@ -774,6 +774,7 @@ int MediaLibrary::List( int listQuery, const 
vlc_ml_query_params_t* params, va_l
     {
         p.desc = params->b_desc;
         p.sort = sortingCriteria( params->i_sort );
+        p.favoriteOnly = params->b_favorite_only;
         nbItems = params->i_nbResults;
         offset = params->i_offset;
         psz_pattern = params->psz_pattern;



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/62fdc8ec2cb2549e5fb215f43373bc09bcd354cc...79df34a5d3534b8f50c6439c2878b6ed87c09e27

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/62fdc8ec2cb2549e5fb215f43373bc09bcd354cc...79df34a5d3534b8f50c6439c2878b6ed87c09e27
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to