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

Commit 47742d4b authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE with inPurgeable Bitmaps in getAllocationByteCount" into klp-dev

parents e77d2a9c 222f2ad2
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;
    }