From c4edac23b2bd8c4024785e8701b61fe1fad13724 Mon Sep 17 00:00:00 2001 From: Adrian Frühwirth Date: Fri, 4 May 2018 18:05:10 +0200 Subject: LAB: Fix UB (use of deallocated memory) --- engines/lab/map.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines') 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()) -- cgit v1.2.3