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

Commit 222f2ad2 authored by Chris Craik's avatar Chris Craik
Browse files

Fix NPE with inPurgeable Bitmaps in getAllocationByteCount

bug:11556330
Change-Id: I430136ea15baeb60adfb9bb2acdde9505ce707fe
parent 19427156
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1167,6 +1167,11 @@ public final class Bitmap implements Parcelable {
     * @see #reconfigure(int, int, Config)
     */
    public final int getAllocationByteCount() {
        if (mBuffer == null) {
            // native backed bitmaps don't support reconfiguration,
            // so alloc size is always content size
            return getByteCount();
        }
        return mBuffer.length;
    }