[vlc-commits] medialibrary: Fix potential null pointer dereference

Hugo Beauzée-Luyssen git at videolan.org
Fri Jun 21 13:55:06 CEST 2019


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Mar 21 16:05:27 2019 +0100| [993db0eb078677b74023d381bd7bbb70e84d839d] | committer: Hugo Beauzée-Luyssen

medialibrary: Fix potential null pointer dereference

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=993db0eb078677b74023d381bd7bbb70e84d839d
---

 modules/misc/medialibrary/entities.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/misc/medialibrary/entities.cpp b/modules/misc/medialibrary/entities.cpp
index 9343e01dc3..0a68f8a1e1 100644
--- a/modules/misc/medialibrary/entities.cpp
+++ b/modules/misc/medialibrary/entities.cpp
@@ -399,6 +399,8 @@ bool Convert( const medialibrary::IFolder* input, vlc_ml_entry_point_t& output )
 
 input_item_t* MediaToInputItem( const medialibrary::IMedia* media )
 {
+    if ( media == nullptr )
+        return nullptr;
     auto files = media->files();
     const auto it = std::find_if( files.cbegin(), files.cend(),
                                   [](const medialibrary::FilePtr& f) {



More information about the vlc-commits mailing list