[vlc-commits] [Git][videolan/vlc][3.0.x] macosx: RendererMenuController: fix incorrect index check

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Mon Sep 7 08:49:34 UTC 2026



Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC


Commits:
b010f544 by Marvin Scholz at 2026-09-07T10:43:06+02:00
macosx: RendererMenuController: fix incorrect index check

The NSMenu indexOf… methods return -1 and not NSNotFound, so the check
here is insufficient and can lead to crashes due to passing a negative
integer to itemAtIndex.

(cherry picked from commit 7f4dbfc43ff9b91190fa452428d9e84411bc714d)

- - - - -


1 changed file:

- modules/gui/macosx/VLCRendererMenuController.m


Changes:

=====================================
modules/gui/macosx/VLCRendererMenuController.m
=====================================
@@ -123,7 +123,7 @@
 - (void)removeRendererItem:(VLCRendererItem *)item
 {
     NSInteger index = [_rendererMenu indexOfItemWithRepresentedObject:item];
-    if (index != NSNotFound) {
+    if (index >= 0) {
         NSMenuItem *menuItem = [_rendererMenu itemAtIndex:index];
         // Don't remove selected item
         if (menuItem != _selectedItem)



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b010f54489a14b5cd8263d1acff2bb0fd9417bb8
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list