check for crazy bounds from fuzzer
Bug: skia:7471 Change-Id: I1d6e2059a0c4f2b705d3b0fe2694f17b68c3ae5c Reviewed-on: https://skia-review.googlesource.com/97122 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
parent
07320e46c0
commit
9cec1bc1a7
@ -1289,6 +1289,7 @@ static void fuzz_canvas(Fuzz* fuzz, SkCanvas* canvas, int depth = 9) {
|
||||
canvas->drawOval(r, paint);
|
||||
break;
|
||||
}
|
||||
case 28: break; // must have deleted this some time earlier
|
||||
case 29: {
|
||||
fuzz_paint(fuzz, &paint, depth - 1);
|
||||
SkRRect rr;
|
||||
|
@ -953,6 +953,9 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag
|
||||
|
||||
if (imageFilter) {
|
||||
clipBounds = imageFilter->filterBounds(clipBounds, ctm);
|
||||
if (clipBounds.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (bounds && !imageFilter->canComputeFastBounds()) {
|
||||
bounds = nullptr;
|
||||
}
|
||||
@ -1395,6 +1398,9 @@ void SkCanvas::resetMatrix() {
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SkCanvas::clipRect(const SkRect& rect, SkClipOp op, bool doAA) {
|
||||
if (!rect.isFinite()) {
|
||||
return;
|
||||
}
|
||||
this->checkForDeferredSave();
|
||||
ClipEdgeStyle edgeStyle = doAA ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle;
|
||||
this->onClipRect(rect, op, edgeStyle);
|
||||
|
Loading…
Reference in New Issue
Block a user