[vlc-commits] macosx/library controller: add missing sanity checks

Felix Paul Kühne git at videolan.org
Wed Oct 16 11:40:07 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Wed Oct 16 11:06:50 2019 +0200| [f0a6115e96e23fcb160865ec7d64a47d51bb8591] | committer: Felix Paul Kühne

macosx/library controller: add missing sanity checks

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

 modules/gui/macosx/library/VLCLibraryController.m | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/gui/macosx/library/VLCLibraryController.m b/modules/gui/macosx/library/VLCLibraryController.m
index ddfe170ab3..f037a35b33 100644
--- a/modules/gui/macosx/library/VLCLibraryController.m
+++ b/modules/gui/macosx/library/VLCLibraryController.m
@@ -182,6 +182,9 @@ float kVLCDefaultThumbnailPosition = .15;
     if (!_p_libraryInstance) {
         return VLC_ENOOBJ;
     }
+    if (!fileURL) {
+        return VLC_EBADVAR;
+    }
     return vlc_ml_add_folder(_p_libraryInstance, [[fileURL absoluteString] UTF8String]);
 }
 
@@ -190,6 +193,9 @@ float kVLCDefaultThumbnailPosition = .15;
     if (!_p_libraryInstance) {
         return VLC_ENOOBJ;
     }
+    if (!fileURL) {
+        return VLC_EBADVAR;
+    }
     return vlc_ml_ban_folder(_p_libraryInstance, [[fileURL absoluteString] UTF8String]);
 }
 
@@ -198,6 +204,9 @@ float kVLCDefaultThumbnailPosition = .15;
     if (!_p_libraryInstance) {
         return VLC_ENOOBJ;
     }
+    if (!fileURL) {
+        return VLC_EBADVAR;
+    }
     return vlc_ml_unban_folder(_p_libraryInstance, [[fileURL absoluteString] UTF8String]);
 }
 
@@ -206,6 +215,9 @@ float kVLCDefaultThumbnailPosition = .15;
     if (!_p_libraryInstance) {
         return VLC_ENOOBJ;
     }
+    if (!fileURL) {
+        return VLC_EBADVAR;
+    }
     return vlc_ml_remove_folder(_p_libraryInstance, [[fileURL absoluteString] UTF8String]);
 }
 



More information about the vlc-commits mailing list