[vlc-commits] [Git][videolan/vlc][master] macosx: Prevent crash from releasing NULL CFURLRef in NSImage extension QuickLook functionality

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Feb 19 19:52:12 UTC 2023



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


Commits:
7df65729 by Claudio Cambra at 2023-02-19T18:30:22+00:00
macosx: Prevent crash from releasing NULL CFURLRef in NSImage extension QuickLook functionality

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


1 changed file:

- modules/gui/macosx/extensions/NSImage+VLCAdditions.m


Changes:

=====================================
modules/gui/macosx/extensions/NSImage+VLCAdditions.m
=====================================
@@ -36,7 +36,18 @@
 {
     NSDictionary *dict = @{(NSString*)kQLThumbnailOptionIconModeKey : [NSNumber numberWithBool:NO]};
     CFDictionaryRef dictRef = CFBridgingRetain(dict);
+    if (dictRef == NULL) {
+        NSLog(@"Got null dict for quickLook preview");
+        return nil;
+    }
+
     CFURLRef urlRef = CFBridgingRetain(url);
+    if (urlRef == NULL) {
+        NSLog(@"Got null url ref for quickLook preview");
+        CFRelease(dictRef);
+        return nil;
+    }
+
     CGImageRef qlThumbnailRef = QLThumbnailImageCreate(kCFAllocatorDefault,
                                                        urlRef,
                                                        size,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7df65729aad2855c204479dcc9bd9e887b88b315

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7df65729aad2855c204479dcc9bd9e887b88b315
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