[vlc-commits] macosx: fix pointer mismatch

Felix Paul Kühne git at videolan.org
Sat Nov 9 02:07:22 CET 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sat Nov  9 10:06:07 2019 +0900| [13e18f3182e2a7b425411ce70ed83161108c3d1f] | committer: Felix Paul Kühne

macosx: fix pointer mismatch

A instance of VLCOpenBlockDeviceDescription was casted to NSDictionary leading to a runtime exception (#23091).

This patch addresses the problem and prevents future issues by setting the class on the arrays.

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

 modules/gui/macosx/windows/VLCOpenWindowController.m | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.m b/modules/gui/macosx/windows/VLCOpenWindowController.m
index 3f79a3fe9c..6d93043fbc 100644
--- a/modules/gui/macosx/windows/VLCOpenWindowController.m
+++ b/modules/gui/macosx/windows/VLCOpenWindowController.m
@@ -95,9 +95,9 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
     BOOL b_nodvdmenus;
     NSView *_currentOpticalMediaView;
     NSImageView *_currentOpticalMediaIconView;
-    NSMutableArray *_allMediaDevices;
-    NSArray *_opticalDevices;
-    NSMutableArray *_specialMediaFolders;
+    NSMutableArray <VLCOpenBlockDeviceDescription *>*_allMediaDevices;
+    NSArray <VLCOpenBlockDeviceDescription *>*_opticalDevices;
+    NSMutableArray <VLCOpenBlockDeviceDescription *>*_specialMediaFolders;
     NSString *_filePath;
     NSString *_fileSlavePath;
     NSString *_subPath;
@@ -835,8 +835,8 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
         NSUInteger count = [self->_allMediaDevices count];
         if (count > 0) {
             for (NSUInteger i = 0; i < count ; i++) {
-                NSDictionary *deviceDict = [self->_allMediaDevices objectAtIndex:i];
-                [self->_discSelectorPopup addItemWithTitle: [[NSFileManager defaultManager] displayNameAtPath:[deviceDict objectForKey:@"path"]]];
+                VLCOpenBlockDeviceDescription *deviceDescription = [self->_allMediaDevices objectAtIndex:i];
+                [self->_discSelectorPopup addItemWithTitle: [[NSFileManager defaultManager] displayNameAtPath:deviceDescription.path]];
             }
 
             if ([self->_discSelectorPopup numberOfItems] <= 1)



More information about the vlc-commits mailing list