From 745279cdedaaacc2a35754d238234208ee17cfe1 Mon Sep 17 00:00:00 2001 From: Matthias Moninger <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 29 Mar 2023 11:50:57 +0300 Subject: [PATCH] Fix #19756: Crash with title sequences containing no commands (#19761) * Fix #19756: Crash with title sequences containing no commands * Update changelog.txt --- distribution/changelog.txt | 1 + src/openrct2-ui/title/TitleSequencePlayer.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c667e8e5f4..2caf77378a 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.5 (in development) ------------------------------------------------------------------------ +- Fix: [#19756] Crash with title sequences containing no commands 0.4.4 (2023-03-28) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index c4a336bdb6..a927c853c7 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -110,6 +110,11 @@ namespace OpenRCT2::Title return false; } + if (_sequence->Commands.empty()) + { + return false; + } + // Run commands in order, until we reach one that is not instantly done int32_t entryPosition = _position; while (true)