Prevent ID2D1RenderTarget::CreateGradientStopCollection from being called with a stop count of zero

RESOLVED DUPLICATE of bug 919757

Status

()

defect
RESOLVED DUPLICATE of bug 919757
5 years ago
5 years ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Working on bug 950372 I'm seeing debug assertions due to us calling ID2D1RenderTarget::CreateGradientStopCollection with a stop count of zero, for example while running content/canvas/test/test_canvas.html subtest test_2d.gradient.empty.html. The assertion is originating from d2d1debug1.dll under the stack:

  mozilla::gfx::DrawTargetD2D::CreateGradientStops
  mozilla::gfx::gfxGradientCache::GetOrCreateGradientStops
  mozilla::dom::CanvasGradient::GetGradientStopsForTarget
  mozilla::dom::CanvasRenderingContext2D::FillRect
  mozilla::dom::CanvasRenderingContext2DBinding::fillRect

The documentation for ID2D1RenderTarget::CreateGradientStopCollection says about the "gradientStopsCount" parameter "A value greater than or equal to 1 that specifies the number of gradient stops in the gradientStops array", so we should protect against passing is zero.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd371830%28v=vs.85%29.aspx
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 919757
You need to log in before you can comment on or make changes to this bug.