Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: src/core/SkCanvas.cpp

Issue 1713383002: fix misc asserts and checks found by fuzzer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/effects/Sk1DPathEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 653f4b117f4fa45b6a475a618a1e1337b0e47c36..aa3261dc033b49cd260f23769df70fad39502c90 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();
}
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/effects/Sk1DPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698