ASYLUM: Fix use-after-free
String goes out of scope but its c_str is still used. Keep a reference while we still need it.
This commit is contained in:
parent
bf669c6d44
commit
0b2c54ad07
1 changed files with 6 additions and 2 deletions
|
@ -190,8 +190,12 @@ void Text::draw(const char *text) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (_vm->getLanguage() == Common::HE_ISR)
|
||||
text = Common::convertBiDiString(text, Common::kWindows1255).c_str();
|
||||
Common::String textRef;
|
||||
|
||||
if (_vm->getLanguage() == Common::HE_ISR) {
|
||||
textRef = Common::convertBiDiString(text, Common::kWindows1255);
|
||||
text = textRef.c_str();
|
||||
}
|
||||
while (*text) {
|
||||
drawChar(text[0]);
|
||||
text++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue