[vlc-commits] [Git][videolan/vlc][3.0.x] macosx: PLItem: clamp pos when inserting
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Mon Nov 24 16:04:37 UTC 2025
Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC
Commits:
761bbd3e by Marvin Scholz at 2025-11-24T16:30:41+01:00
macosx: PLItem: clamp pos when inserting
Pos needs to be clamped to the amount of items in the array, else
we might try to insert at an invalid position in the array.
This can happen because the playlist can change till we process the
insertion request, so an item that would have been inserted before at
position 0 is dropped and then we try to insert the next item at
position 1 which would lead to an exception as it is outside the array
bounds.
This is easy to reproduce when using the flattened playlist and dragging
a folder with a few items and a subfolder onto the icon or playlist.
Fix #28660
- - - - -
1 changed file:
- modules/gui/macosx/VLCPLItem.m
Changes:
=====================================
modules/gui/macosx/VLCPLItem.m
=====================================
@@ -75,6 +75,7 @@
- (void)addChild:(VLCPLItem *)item atPos:(int)pos
{
+ pos = VLC_CLIP(pos, 0, (int)_children.count);
[_children insertObject:item atIndex:pos];
[item setParent: self];
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/761bbd3e0dcf0dcafbda2e3edd895e94b9690635
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/761bbd3e0dcf0dcafbda2e3edd895e94b9690635
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