From c79e2d1551517093f49f3c77ca7dae19c8fe2651 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Thu, 26 Apr 2018 10:22:10 -0400 Subject: [PATCH] Check negative width before blitAntiRect Since we decrease the width when clipped, it might be negative. Bug: skia:7858 Change-Id: I348bd07d917905a55bec1a4b4e0915c6528fe6b1 Reviewed-on: https://skia-review.googlesource.com/123927 Auto-Submit: Yuqian Li Reviewed-by: Mike Klein Commit-Queue: Yuqian Li --- src/core/SkBlitter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index da2ea0c08e..5cf8147019 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -147,7 +147,9 @@ void SkBlitter::blitCoverageDeltas(SkCoverageDeltaList* deltas, const SkIRect& c height -= botOverClip; } - this->blitAntiRect(rectX, rectY, width, height, leftAlpha, rightAlpha); + if (width >= 0) { + this->blitAntiRect(rectX, rectY, width, height, leftAlpha, rightAlpha); + } y += antiRect.fHeight - 1; // -1 because ++y in the for loop continue; }