Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure sub-bitmaps have a non-zero width and height
When images have a width or height greater than zero but less than the sample size, then the sub-bitmap can have a zero width or height, which causes Bitmap.createBitmap() to crash. By ensuring a height of at least 1, we avoid those crashes. Fatal Exception: java.lang.IllegalArgumentException height must be > 0 android.graphics.Bitmap.checkWidthHeight (Bitmap.java:413) android.graphics.Bitmap.createBitmap (Bitmap.java:732) android.graphics.Bitmap.createBitmap (Bitmap.java:701) com.google.android.apps.muzei.render.BitmapRegionLoader.decodeRegion (BitmapRegionLoader.kt:177) com.google.android.apps.muzei.render.GLPicture.<init> (GLPicture.kt:157) com.google.android.apps.muzei.render.GLPictureKt.toGLPicture (GLPicture.kt:32) com.google.android.apps.muzei.render.MuzeiBlurRenderer$GLPictureSet.load$muzei_publicBeta (MuzeiBlurRenderer.kt:325) com.google.android.apps.muzei.render.MuzeiBlurRenderer.setAndConsumeBitmapRegionLoader (MuzeiBlurRenderer.kt:266)
- Loading branch information