Skip to content

Commit

Permalink
Bug 1244918 - avoid using Infs for line start and end when painting g…
Browse files Browse the repository at this point in the history
…radients. r=mstange
  • Loading branch information
lsalzman committed Apr 24, 2016
1 parent 5e045b7 commit f35be2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions layout/base/nsCSSRendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2486,6 +2486,10 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext,
ComputeRadialGradientLine(aPresContext, aGradient, srcSize,
&lineStart, &lineEnd, &radiusX, &radiusY);
}
// Avoid sending Infs or Nans to downwind draw targets.
if (!lineStart.IsFinite() || !lineEnd.IsFinite()) {
lineStart = lineEnd = gfxPoint(0, 0);
}
gfxFloat lineLength = NS_hypot(lineEnd.x - lineStart.x,
lineEnd.y - lineStart.y);

Expand Down

0 comments on commit f35be2e

Please sign in to comment.