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

Commit 01af516a authored by Chris Craik's avatar Chris Craik
Browse files

Fix nine patch crash

bug:15598400

Prevent destroying a NULL chunk

Change-Id: Iea0ac5311ca8061f60c02669cd9b87eededf1b1d
parent ccc1ecb1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -118,7 +118,10 @@ public class NinePatch {
    @Override
    protected void finalize() throws Throwable {
        try {
            if (mNativeChunk != 0) {
                // only attempt to destroy correctly initilized chunks
                nativeFinalize(mNativeChunk);
            }
        } finally {
            super.finalize();
        }
+2 −2
Original line number Diff line number Diff line
@@ -613,10 +613,10 @@ public class NinePatchDrawable extends Drawable {
            this(ninePatch, padding, opticalInsets, DEFAULT_DITHER, false);
        }

        NinePatchState(NinePatch ninePatch, Rect rect, Rect opticalInsets, boolean dither,
        NinePatchState(NinePatch ninePatch, Rect padding, Rect opticalInsets, boolean dither,
                boolean autoMirror) {
            mNinePatch = ninePatch;
            mPadding = rect;
            mPadding = padding;
            mOpticalInsets = Insets.of(opticalInsets);
            mDither = dither;
            mAutoMirrored = autoMirror;