mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
CRYOMNI3D: Fix use after free when playing dialog
This commit is contained in:
parent
8d770af865
commit
c7205da58b
@ -257,6 +257,9 @@ bool DialogsManager::play(const Common::String &sequence, bool &slowStop) {
|
||||
bool playerLabel = !strncmp(label, "JOU", 3);
|
||||
bool didSomething = false;
|
||||
bool finished = false;
|
||||
/* Keep the gotoList outside the loop to avoid it being freed at the end of it and
|
||||
* having label possibly pointing on free memory */
|
||||
Common::Array<DialogsManager::Goto> gotoList;
|
||||
while (!finished) {
|
||||
const char *actions;
|
||||
if (playerLabel) {
|
||||
@ -284,7 +287,7 @@ bool DialogsManager::play(const Common::String &sequence, bool &slowStop) {
|
||||
didSomething = true;
|
||||
actions = nextLine(text);
|
||||
}
|
||||
Common::Array<DialogsManager::Goto> gotoList = executeAfterPlayAndBuildGotoList(actions);
|
||||
gotoList = executeAfterPlayAndBuildGotoList(actions);
|
||||
Common::StringArray questions;
|
||||
bool endOfConversationFound = false;;
|
||||
if (_ignoreNoEndOfConversation) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user