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

Commit ffee0749 authored by Leon Scroggins III's avatar Leon Scroggins III Committed by Android Git Automerger
Browse files

am 1d5b35d4: am aba3ecb9: Merge "Fix overflow in NinePatchImpl." into mnc-dev

* commit '1d5b35d4':
  Fix overflow in NinePatchImpl.
parents 3284dd43 1d5b35d4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -180,7 +180,10 @@ void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
    const int bitmapWidth = bitmap.width();
    const int bitmapHeight = bitmap.height();

    SkScalar* dstRights = (SkScalar*) alloca((numXDivs + 1) * sizeof(SkScalar));
    // Number of bytes needed for dstRights array.
    // Need to cast numXDivs to a larger type to avoid overflow.
    const size_t dstBytes = ((size_t) numXDivs + 1) * sizeof(SkScalar);
    SkScalar* dstRights = (SkScalar*) alloca(dstBytes);
    bool dstRightsHaveBeenCached = false;

    int numStretchyXPixelsRemaining = 0;