From e4293d86fdb0c3618bcd8776ff86b1a2a23a72da Mon Sep 17 00:00:00 2001 From: Josh Dhaliwal Date: Sun, 26 Feb 2012 19:59:22 -0800 Subject: [PATCH] Bug 727905 - Zero width window handling in nsWindow.cpp crash. r=dougt --- widget/android/nsWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index e2da79fcf7a..1a831104761 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -972,8 +972,8 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae) if (points.Length() > 0) { pt = points[0]; } - pt.x = clamped(pt.x, 0, gAndroidBounds.width - 1); - pt.y = clamped(pt.y, 0, gAndroidBounds.height - 1); + pt.x = clamped(pt.x, 0, PR_MAX(gAndroidBounds.width - 1, 0)); + pt.y = clamped(pt.y, 0, PR_MAX(gAndroidBounds.height - 1, 0)); nsWindow *target = win->FindWindowForPoint(pt); #if 0 ALOG("MOTION_EVENT %f,%f -> %p (visible: %d children: %d)", pt.x, pt.y, (void*)target,