Skip to content

Commit

Permalink
Return false from CanvasState::IsPointInPath for NaN/infinite values
Browse files Browse the repository at this point in the history
  • Loading branch information
teapotd committed Oct 28, 2019
1 parent ac83c7f commit 35a48a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/script/canvas_state.rs
Expand Up @@ -1241,6 +1241,10 @@ impl CanvasState {
y: f64,
fill_rule: CanvasFillRule,
) -> bool {
if !(x.is_finite() && y.is_finite()) {
return false;
}

let fill_rule = match fill_rule {
CanvasFillRule::Nonzero => FillRule::Nonzero,
CanvasFillRule::Evenodd => FillRule::Evenodd,
Expand Down

0 comments on commit 35a48a7

Please sign in to comment.