From 6512d717e168fd1a5253a7ebe31e772824131de7 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 3 Jan 2009 17:10:20 +0000 Subject: (svn r14811) -Fix: off-by-one causing possible out-of-bounds reads. --- src/music_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/music_gui.cpp b/src/music_gui.cpp index d81fb41d3..d92477279 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -118,7 +118,7 @@ static void SelectSongToPlay() _cur_playlist[j] = _playlists[msf.playlist][i]; j++; } - } while (_playlists[msf.playlist][i++] != 0 && j < lengthof(_cur_playlist) - 1); + } while (_playlists[msf.playlist][++i] != 0 && j < lengthof(_cur_playlist) - 1); /* Do not shuffle when on the intro-start window, as the song to play has to be the original TTD Theme*/ if (msf.shuffle && _game_mode != GM_MENU) { -- cgit v1.2.3-54-g00ecf