From bc8b952d7169820213551dcdacccbebb66e1d84a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 18 Aug 2017 10:17:29 +0200 Subject: GRAPHICS: MACGUI: Perform sanity checks before blitting --- graphics/macgui/macwindowmanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 9a3e711c19..8eaf8e9f5b 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -289,8 +289,10 @@ void MacWindowManager::draw() { Common::Rect clip(w->getDimensions().left - 2, w->getDimensions().top - 2, w->getDimensions().right - 2, w->getDimensions().bottom - 2); clip.clip(_screen->getBounds()); + clip.clip(Common::Rect(0, 0, g_system->getWidth() - 1, g_system->getHeight() - 1)); - g_system->copyRectToScreen(_screen->getBasePtr(clip.left, clip.top), _screen->pitch, clip.left, clip.top, clip.width(), clip.height()); + if (!clip.isEmpty()) + g_system->copyRectToScreen(_screen->getBasePtr(clip.left, clip.top), _screen->pitch, clip.left, clip.top, clip.width(), clip.height()); } } -- cgit v1.2.3