From 9d999905fdd75a2f6fce89ef7e73815d206d54f5 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 1 Mar 2013 13:27:28 -0800 Subject: Fix crash if a tile ends up with a width or height of 0 Bug: 8242279 Change-Id: Id8f9d85b46f07fb5aea8063a081524b9a3d992ae --- src/com/android/gallery3d/glrenderer/BasicTexture.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com') diff --git a/src/com/android/gallery3d/glrenderer/BasicTexture.java b/src/com/android/gallery3d/glrenderer/BasicTexture.java index 82eb5a7ee..2e77b903f 100644 --- a/src/com/android/gallery3d/glrenderer/BasicTexture.java +++ b/src/com/android/gallery3d/glrenderer/BasicTexture.java @@ -78,8 +78,8 @@ public abstract class BasicTexture implements Texture { public void setSize(int width, int height) { mWidth = width; mHeight = height; - mTextureWidth = Utils.nextPowerOf2(width); - mTextureHeight = Utils.nextPowerOf2(height); + mTextureWidth = width > 0 ? Utils.nextPowerOf2(width) : 0; + mTextureHeight = height > 0 ? Utils.nextPowerOf2(height) : 0; if (mTextureWidth > MAX_TEXTURE_SIZE || mTextureHeight > MAX_TEXTURE_SIZE) { Log.w(TAG, String.format("texture is too large: %d x %d", mTextureWidth, mTextureHeight), new Exception()); -- cgit v1.2.3