aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-05-13 13:36:34 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-13 18:05:16 +0000
commitb06a1eb4e5793b5053981cc76c72c497650c0e1a (patch)
treee2dd470121cf18caac62bc68b95d741acc5fee2c /src/core/SkImageFilter.cpp
parentec48812c5a5416595d97745715a6cd10ad60fc33 (diff)
detect overflow for morphology
Bug: oss-fuzz:8236 Change-Id: Iae911d995cbfed77c5d332f615da1a8d9b487c21 Reviewed-on: https://skia-review.googlesource.com/127703 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkImageFilter.cpp')
-rw-r--r--src/core/SkImageFilter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 015b77c42c..2a898fda14 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -425,8 +425,8 @@ sk_sp<SkSpecialImage> SkImageFilter::applyCropRect(const Context& ctx,
} else {
sk_sp<SkSpecialImage> img(pad_image(src, ctx.outputProperties(),
bounds->width(), bounds->height(),
- srcOffset->x() - bounds->x(),
- srcOffset->y() - bounds->y()));
+ Sk32_sat_sub(srcOffset->x(), bounds->x()),
+ Sk32_sat_sub(srcOffset->y(), bounds->y())));
*srcOffset = SkIPoint::Make(bounds->x(), bounds->y());
return img;
}