Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
3a074cec by Claudio Cambra at 2024-12-16T14:44:42+00:00
macosx: Prevent OOB crash when backing array is empty in abstract grouping data 
source

Signed-off-by: Claudio Cambra <develo...@claudiocambra.com>

- - - - -
cdd4b633 by Claudio Cambra at 2024-12-16T14:44:42+00:00
macosx: Better safeguard against invalid indices in abstract grouping source 
number of rows

Signed-off-by: Claudio Cambra <develo...@claudiocambra.com>

- - - - -


1 changed file:

- modules/gui/macosx/library/VLCLibraryAbstractGroupingDataSource.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryAbstractGroupingDataSource.m
=====================================
@@ -72,7 +72,10 @@
     }
 
     const NSInteger selectedMasterRow = self.masterTableView.selectedRow;
-    if (tableView == self.detailTableView && selectedMasterRow > -1) {
+    const NSInteger backingItemsCount = self.backingArray.count;
+    const BOOL selectedRowIsValid = selectedMasterRow > -1 && 
selectedMasterRow < backingItemsCount;
+
+    if (tableView == self.detailTableView && backingItemsCount > 0 && 
selectedRowIsValid) {
         return self.backingArray[selectedMasterRow].mediaItems.count;
     }
 



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/86ecd6d0a0aba18833f4b764651af4888576733f...cdd4b633ef6d84e0204fb4dd14b012a55e3649ed

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/86ecd6d0a0aba18833f4b764651af4888576733f...cdd4b633ef6d84e0204fb4dd14b012a55e3649ed
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