summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2013-03-01 21:35:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-01 21:35:49 +0000
commit4b3084078c1c503e0d7ba17dfadc244ab246da06 (patch)
tree322c1f083ef10a2011ddb75ca1277746c34403b1 /src
parent86d9386787c95ac8c98b661e69c458aa8de0e02a (diff)
parent9d999905fdd75a2f6fce89ef7e73815d206d54f5 (diff)
downloadandroid_packages_apps_Snap-4b3084078c1c503e0d7ba17dfadc244ab246da06.tar.gz
android_packages_apps_Snap-4b3084078c1c503e0d7ba17dfadc244ab246da06.tar.bz2
android_packages_apps_Snap-4b3084078c1c503e0d7ba17dfadc244ab246da06.zip
Merge "Fix crash if a tile ends up with a width or height of 0" into gb-ub-photos-bryce
Diffstat (limited to 'src')
-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());