aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-05-04 18:05:10 +0200
committerAdrian Frühwirth2018-05-05 17:54:46 +0200
commitc4edac23b2bd8c4024785e8701b61fe1fad13724 (patch)
tree0e3fa0692ab7afa96d8ffef42ab92c2254cb60ec /engines/lab
parent88d4e5475d6541f8cc1bf5ddda81f2755ec06ba4 (diff)
downloadscummvm-rg350-c4edac23b2bd8c4024785e8701b61fe1fad13724.tar.gz
scummvm-rg350-c4edac23b2bd8c4024785e8701b61fe1fad13724.tar.bz2
scummvm-rg350-c4edac23b2bd8c4024785e8701b61fe1fad13724.zip
LAB: Fix UB (use of deallocated memory)
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/map.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index 057cac3589..a856b76885 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -367,13 +367,11 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad
_imgHugeMaze->drawImage(_utils->mapScaleX(524), _utils->mapScaleY(97));
} else if (floorNum == kFloorSurMaze) {
Common::Rect textRect = Common::Rect(_utils->mapScaleX(360), 0, _utils->mapScaleX(660), _utils->mapScaleY(450));
- const char *textPtr = _resource->getStaticText(kTextSurmazeMessage).c_str();
- _graphics->flowText(_msgFont, 0, 7, 0, true, true, true, true, textRect, textPtr);
+ _graphics->flowText(_msgFont, 0, 7, 0, true, true, true, true, textRect, _resource->getStaticText(kTextSurmazeMessage).c_str());
}
if ((floorNum >= kFloorLower) && (floorNum <= kFloorCarnival)) {
- const char *textPrt = _resource->getStaticText(floorNum - 1).c_str();
- _graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 75, 134, 97), textPrt);
+ _graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 75, 134, 97), _resource->getStaticText(floorNum - 1).c_str());
}
if (!_rooms[curMsg]._roomMsg.empty())