From 7c2bd56776672a9947010c48c6ca102742b0068f Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 1 Jun 2026 22:12:43 +0200 Subject: [PATCH] cellMusic: don't set current_track to umax on prev There's no reason to do that and it might cause OOB access elsewhere. --- rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp b/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp index 129a3d00e3..6ce57e294f 100644 --- a/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp @@ -301,7 +301,7 @@ u32 music_selection_context::step_track(bool next) { // We are at the end of the playlist. cellMusicSelectionContext.notice("step_track: No more tracks to play in playlist..."); - current_track = playlist.size() - 1; // NOTE: We could use size instead of size - 1 to allow to use PREV to play the last track again. + current_track = ::size32(playlist) - 1; // NOTE: We could use size instead of size - 1 to allow to use PREV to play the last track again. return umax; } } @@ -312,7 +312,6 @@ u32 music_selection_context::step_track(bool next) { // We are at the start of the playlist. cellMusicSelectionContext.notice("step_track: No more tracks to play in playlist..."); - current_track = umax; return umax; } @@ -337,7 +336,7 @@ u32 music_selection_context::step_track(bool next) // Play the previous track. Start with the last track if we reached the start of the playlist. if (current_track == 0) { - current_track = ::narrow(playlist.size() - 1); + current_track = ::size32(playlist) - 1; } else {