diff options
author | John Reck <jreck@google.com> | 2013-03-01 21:35:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-01 21:35:49 +0000 |
commit | 4b3084078c1c503e0d7ba17dfadc244ab246da06 (patch) | |
tree | 322c1f083ef10a2011ddb75ca1277746c34403b1 | |
parent | 86d9386787c95ac8c98b661e69c458aa8de0e02a (diff) | |
parent | 9d999905fdd75a2f6fce89ef7e73815d206d54f5 (diff) | |
download | android_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
-rw-r--r-- | src/com/android/gallery3d/glrenderer/BasicTexture.java | 4 |
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()); |