Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 836f93dc authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Never resize a Bitmap down to 0 at load time Bug #8313929" into jb-mr2-dev

parents 42ca4975 fe28ef84
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -566,8 +566,9 @@ public class BitmapFactory {
            float scale = targetDensity / (float) density;
            if (scale != 1.0f) {
                final Bitmap oldBitmap = bm;
                bm = Bitmap.createScaledBitmap(oldBitmap, (int) (bm.getWidth() * scale + 0.5f),
                        (int) (bm.getHeight() * scale + 0.5f), true);
                bm = Bitmap.createScaledBitmap(oldBitmap,
                        Math.max(1, (int) (bm.getWidth() * scale + 0.5f)),
                        Math.max(1, (int) (bm.getHeight() * scale + 0.5f)), true);
                if (bm != oldBitmap) oldBitmap.recycle();

                if (isNinePatch) {