[vlc-commits] [Git][videolan/vlc][master] macosx: Fix crash on search in home view

François Cartegnie (@fcartegnie) gitlab at videolan.org
Sat Mar 2 10:06:45 UTC 2024



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
a56516ad by Claudio Cambra at 2024-03-02T09:41:32+00:00
macosx: Fix crash on search in home view

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

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryHeroView.m
=====================================
@@ -79,9 +79,10 @@
 - (VLCMediaLibraryMediaItem *)randomItem
 {
     VLCLibraryModel * const libraryModel = VLCMain.sharedInstance.libraryController.libraryModel;
-    const size_t videoCount = libraryModel.numberOfVideoMedia;
+    NSArray * const videos = libraryModel.listOfVideoMedia;
+    const NSInteger videoCount = videos.count;
     const uint32_t randIdx = arc4random_uniform((uint32_t)(videoCount - 1));
-    return [libraryModel.listOfVideoMedia objectAtIndex:randIdx];
+    return [videos objectAtIndex:randIdx];
 }
 
 - (VLCMediaLibraryMediaItem *)latestPartiallyPlayedItem



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

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