[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Prevent OOB crash when backing array is empty in abstract grouping data source

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Mon Dec 16 15:00:25 UTC 2024



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 <developer at 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 <developer at 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


More information about the vlc-commits mailing list