diff options
author | 2016-02-20 14:18:27 -0800 | |
---|---|---|
committer | 2016-02-20 14:18:27 -0800 | |
commit | 00bea4ad310c4ec4dd95809b47ce3fbfa8fd0e1e (patch) | |
tree | 8c7e11efbc4c108252a219c763010d5035b10846 /src/core | |
parent | f5d4746ad73ef5eabc927d3d988bb9ee97c77921 (diff) |
fix misc asserts and checks found by fuzzer
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1713383002
TBR=robertphilips
Review URL: https://codereview.chromium.org/1713383002
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 653f4b117f..aa3261dc03 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1072,11 +1072,14 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag if (!this->getClipDeviceBounds(&clipBounds)) { return false; } + SkASSERT(!clipBounds.isEmpty()); const SkMatrix& ctm = fMCRec->fMatrix; // this->getTotalMatrix() if (imageFilter) { - imageFilter->filterBounds(clipBounds, ctm, &clipBounds); + if (!imageFilter->filterBounds(clipBounds, ctm, &clipBounds) || clipBounds.isEmpty()) { + return false; + } if (bounds && !imageFilter->canComputeFastBounds()) { bounds = nullptr; } @@ -1778,6 +1781,7 @@ bool SkCanvas::getClipDeviceBounds(SkIRect* bounds) const { return false; } + SkASSERT(!clip.getBounds().isEmpty()); if (bounds) { *bounds = clip.getBounds(); } |