summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-11-01 23:06:09 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-11-01 23:06:09 +0100
commit37d41674c2b1a706c95c2c326cbfbd06b0c1a655 (patch)
treea110a8320b54698e9c1c5a1cbb55b473756881fc /android
parent9a52bad40ab96a58bc817fbfe1145a6766d75940 (diff)
android: don't crash in LO when SurfaceView layout is 0 width
Change-Id: I49be19b273d0c263637369e9b095f374b345191b
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java b/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
index e11c91c59fcc..e902a060a69b 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
@@ -149,6 +149,11 @@ public abstract class ComposedTileLayer extends Layer implements ComponentCallba
RectF newViewPort = getViewPort(viewportMetrics);
float newZoom = getZoom(viewportMetrics);
+ // When
+ if (newZoom <= 0.0 || Float.isNaN(newZoom)) {
+ return;
+ }
+
if (currentViewport.equals(newViewPort) && FloatUtils.fuzzyEquals(currentZoom, newZoom)) {
return;
}