summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2013-03-01 13:27:28 -0800
committerJohn Reck <jreck@google.com>2013-03-01 13:27:28 -0800
commit9d999905fdd75a2f6fce89ef7e73815d206d54f5 (patch)
tree6cd62db96b5f6fef758550657750b2d69cf84b21
parent6af159148657ac1c10652a29ae415b14d5a41930 (diff)
downloadandroid_packages_apps_Snap-9d999905fdd75a2f6fce89ef7e73815d206d54f5.tar.gz
android_packages_apps_Snap-9d999905fdd75a2f6fce89ef7e73815d206d54f5.tar.bz2
android_packages_apps_Snap-9d999905fdd75a2f6fce89ef7e73815d206d54f5.zip
Fix crash if a tile ends up with a width or height of 0
Bug: 8242279 Change-Id: Id8f9d85b46f07fb5aea8063a081524b9a3d992ae
-rw-r--r--src/com/android/gallery3d/glrenderer/BasicTexture.java4
1 files changed, 2 insertions, 2 deletions
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());