mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
VKEYBD: Properly error out parsing if an area is defined again.
Formerly the code did never check whether ImageMap::createArea returned a valid pointer and always just assumed so.
This commit is contained in:
parent
d0ddd299a4
commit
24d99038e4
@ -313,10 +313,16 @@ bool VirtualKeyboardParser::parserCallback_area(ParserNode *node) {
|
||||
return parseRect(_mode->displayArea, coords);
|
||||
} else if (shape.equalsIgnoreCase("rect")) {
|
||||
Polygon *poly = _mode->imageMap.createArea(target);
|
||||
return parseRectAsPolygon(*poly, coords);
|
||||
if (!poly)
|
||||
return parserError(Common::String::format("Cannot define area '%s' again", target.c_str()));
|
||||
else
|
||||
return parseRectAsPolygon(*poly, coords);
|
||||
} else if (shape.equalsIgnoreCase("poly")) {
|
||||
Polygon *poly = _mode->imageMap.createArea(target);
|
||||
return parsePolygon(*poly, coords);
|
||||
if (!poly)
|
||||
return parserError(Common::String::format("Cannot define area '%s' again", target.c_str()));
|
||||
else
|
||||
return parsePolygon(*poly, coords);
|
||||
}
|
||||
return parserError("Area shape '" + shape + "' not known");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user