Commit 141ee7b1 authored by Yi Xu's avatar Yi Xu Committed by Commit Bot

Fix assertion error in SkPaint::computeFastBounds

Fix the crashes in the clusterfuzz: SkPaint::computeFastBounds failed
to check if the rect it computes on is finite.

Bug: 1041787

Change-Id: If7fc827fb20cbc5f23424b0bb087f39a680a7a21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2008190Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: Yi Xu <yiyix@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738446}
parent 9a9fe199
...@@ -2103,7 +2103,7 @@ gfx::Rect PaintOp::ComputePaintRect(const PaintOp* op, ...@@ -2103,7 +2103,7 @@ gfx::Rect PaintOp::ComputePaintRect(const PaintOp* op,
SkRect paint_rect = MapRect(ctm, op_rect); SkRect paint_rect = MapRect(ctm, op_rect);
if (flags) { if (flags) {
SkPaint paint = flags->ToSkPaint(); SkPaint paint = flags->ToSkPaint();
paint_rect = paint.canComputeFastBounds() paint_rect = paint.canComputeFastBounds() && paint_rect.isFinite()
? paint.computeFastBounds(paint_rect, &paint_rect) ? paint.computeFastBounds(paint_rect, &paint_rect)
: clip_rect; : clip_rect;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment