aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui
diff options
context:
space:
mode:
authorEugene Sandulenko2019-09-29 17:28:50 +0200
committerEugene Sandulenko2019-09-29 17:28:50 +0200
commitab14c410381b66ebc53e71d29438047e5fa457da (patch)
treeb35e28304efaf1af941ea16b8d591a3f30a175b2 /graphics/macgui
parent7f7730bd7f6f32efe9ea8bba9f6de0d73c2a0cd3 (diff)
downloadscummvm-rg350-ab14c410381b66ebc53e71d29438047e5fa457da.tar.gz
scummvm-rg350-ab14c410381b66ebc53e71d29438047e5fa457da.tar.bz2
scummvm-rg350-ab14c410381b66ebc53e71d29438047e5fa457da.zip
GRAPHICS: MACGUI: Added safaguards to border blitting
Diffstat (limited to 'graphics/macgui')
-rw-r--r--graphics/macgui/macwindowborder.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/graphics/macgui/macwindowborder.cpp b/graphics/macgui/macwindowborder.cpp
index a8efdd3a67..f11fbdd12e 100644
--- a/graphics/macgui/macwindowborder.cpp
+++ b/graphics/macgui/macwindowborder.cpp
@@ -79,8 +79,17 @@ void MacWindowBorder::blitBorderInto(ManagedSurface &destination, bool active) {
TransparentSurface srf;
NinePatchBitmap *src = active ? _activeBorder : _inactiveBorder;
+ if ((active && !_activeInitialized) || (!active && !_inactiveInitialized)) {
+ warning("Attempt to blit unitialised border");
+ }
+
+ if (destination.w == 0 || destination.h == 0) {
+ warning("Attempt to draw %d x %d window", destination.w, destination.h);
+ return;
+ }
+
srf.create(destination.w, destination.h, destination.format);
- srf.fillRect(Common::Rect(0, 0, srf.w, srf.h), kColorGreen2);
+ srf.fillRect(Common::Rect(srf.w, srf.h), kColorGreen2);
byte palette[kColorCount];
g_system->getPaletteManager()->grabPalette(palette, 0, kColorCount);