aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-03-16 19:19:59 +0000
committerFilippos Karapetis2009-03-16 19:19:59 +0000
commit9ec640633d96946369a1ba331ebf0a09956a7c7e (patch)
tree4ff52d29261b8b0c1a36b3397c0de4208a9f657a /engines
parent7cd1ac52319f33444a0ef750fbbb7ca3973cca61 (diff)
downloadscummvm-rg350-9ec640633d96946369a1ba331ebf0a09956a7c7e.tar.gz
scummvm-rg350-9ec640633d96946369a1ba331ebf0a09956a7c7e.tar.bz2
scummvm-rg350-9ec640633d96946369a1ba331ebf0a09956a7c7e.zip
It seems that the SCI GUI code tries to show rectangles with negative height. Added some sanity checks for this, but the *real* problem lies elsewhere
svn-id: r39451
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gfx/gfx_widgets.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp
index e4103d46ff..0b2abf4cc5 100644
--- a/engines/sci/gfx/gfx_widgets.cpp
+++ b/engines/sci/gfx/gfx_widgets.cpp
@@ -491,6 +491,12 @@ static int _gfxwop_primitive_equals(gfxw_widget_t *widget, gfxw_widget_t *other)
oprim = (gfxw_primitive_t *) other;
+ // FIXME: I'm not even sure why this happens...
+ if (wprim->bounds.height < 0 || oprim->bounds.height < 0) {
+ warning("_gfxwop_primitive_equals: height < 0");
+ return 0;
+ }
+
if (!toCommonRect(wprim->bounds).equals(toCommonRect(oprim->bounds)))
return 0;
@@ -1970,6 +1976,11 @@ int gfxw_widget_matches_snapshot(gfxw_snapshot_t *snapshot, gfxw_widget_t *widge
if (!GFXW_IS_CONTAINER(widget) && widget->parent) {
bounds.x += widget->parent->bounds.x;
bounds.y += widget->parent->bounds.y;
+ // FIXME: I'm not even sure why this happens...
+ if (bounds.height < 0) {
+ warning("gfxw_widget_matches_snapshot: height < 0");
+ return 0;
+ }
}
return ((widget->serial >= free_above_eq || widget->serial < free_below) &&