From e41c3c50de4e1b077806b605466b5f01c9cb42c5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 30 Jan 2016 23:53:52 +0100 Subject: [PATCH] WAGE: Fix crash in Deep Angst, when border is beyond the screen --- engines/wage/gui.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 354616b470df..ad212f216689 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -398,6 +398,11 @@ void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowTy font->drawString(g, _scene->_name, x + (width - w) / 2 + 5, y + yOff, w, kColorBlack); } + if (x + width > _screen.w) + width = _screen.w - x; + if (y + height > _screen.h) + height = _screen.h - y; + g_system->copyRectToScreen(g->getBasePtr(x, y), g->pitch, x, y, width, height); }