KEMBAR78
GLK:SCOTT: Fix assert failed after calling Scott::fatal() by hari01584 · Pull Request #4745 · scummvm/scummvm · GitHub
Skip to content

Conversation

@hari01584
Copy link
Contributor

As raised by 14257, Scott engine gives error of
scummvm: ./common/array.h:234: T& Common::Array<T>::operator[](Common::Array<T>::size_type) [with T = Glk::Scott::Item; Common::Array<T>::size_type = unsigned int]: Assertion idx < _size' failed.

It happens because the shouldQuit() function

while (!shouldQuit()) {
is checked after saving state _G(_initialState) = saveCurrentState(); which obviously in unsupported game will crash!

Fixed it by checking if there is quit event when calling saveCurrentState()!

@angstsmurf
Copy link
Contributor

Can confirm that this makes ScummVM exit cleanly instead of crashing with an assert when trying to run an unsupported game.

@sev- sev- merged commit 63af61b into scummvm:master Mar 2, 2023
@sev-
Copy link
Member

sev- commented Mar 2, 2023

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants