From b82665e78f3a4f08e7b620b85246b7925097386b Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 23 Sep 2009 12:49:28 -0400 Subject: [PATCH] don't allow min scale to go to infinity When a new picture is received, the min zoom scale is set. One of the many choices divides by draw.mMinPrefWidth, even if it is zero. Add a check to require it to be greater than zero before using it as a ratio component. fixes http://b/issue?id=2138786 --- core/java/android/webkit/WebView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index a3e692ef1a0c2..8c63692c124ad 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -4868,7 +4868,8 @@ public class WebView extends AbsoluteLayout mLastScale = restoreState.mTextWrapScale; if (restoreState.mMinScale == 0) { if (restoreState.mMobileSite) { - if (draw.mMinPrefWidth > draw.mViewPoint.x) { + if (draw.mMinPrefWidth > + Math.max(0, draw.mViewPoint.x)) { mMinZoomScale = (float) viewWidth / draw.mMinPrefWidth; mMinZoomScaleFixed = false;