aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-05-23 10:08:53 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-23 14:33:51 +0000
commit5bedc80b269caba0ef9a649b5f6f3c3bd8dda596 (patch)
tree63051835782d8f7551500a988fc4404af977358e /src
parentf104fec6d745540019556823f849535fe8872653 (diff)
reduce clip-limit for scan converter to avoid quad-edge overflow
For raster drawing, we already have a more conservative guard in SkBitmapDevice, which "tiles" the drawing on 8K boundaries (the smaller limit needed for antialiasing scan converters). This change is just needed for non-drawing uses of the scan converter. Bug: skia:7998 Bug: oss-fuzz:8483 Change-Id: Icfee9ca1ffcf93a2a8a3078d9ee10494fa04a6c7 Reviewed-on: https://skia-review.googlesource.com/129628 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkScan_Path.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index 90a2230526..4110b832a9 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -550,7 +550,9 @@ SkScanClipper::SkScanClipper(SkBlitter* blitter, const SkRegion* clip,
///////////////////////////////////////////////////////////////////////////////
static bool clip_to_limit(const SkRegion& orig, SkRegion* reduced) {
- const int32_t limit = 32767;
+ // need to limit coordinates such that the width/height of our rect can be represented
+ // in SkFixed (16.16). See skbug.com/7998
+ const int32_t limit = 32767 >> 1;
SkIRect limitR;
limitR.set(-limit, -limit, limit, limit);