From 506748c82f70e809d5a1cd2270164506ca1fbb06 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 12 Jan 2016 19:41:52 +0100 Subject: WAGE: Do not crash on empty submenus --- engines/wage/menu.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/wage') diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp index 2ed41bc510..bae8d76be8 100644 --- a/engines/wage/menu.cpp +++ b/engines/wage/menu.cpp @@ -266,6 +266,9 @@ void Menu::render() { void Menu::renderSubmenu(MenuItem *menu) { Common::Rect *r = &menu->subbbox; + if (r->width() == 0 || r->height() == 0) + return; + Design::drawFilledRect(&_gui->_screen, *r, kColorWhite, _patterns, 1); Design::drawRect(&_gui->_screen, *r, 1, kColorBlack, _patterns, 1); -- cgit v1.2.3