From 8def940a99df991c0193a460fc9ae7c241704d61 Mon Sep 17 00:00:00 2001 From: Dom Lachowicz Date: Fri, 14 Mar 2003 15:36:11 +0000 Subject: bug 108380, w3 svg conformance improvements --- rsvg-path.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rsvg-path.c') diff --git a/rsvg-path.c b/rsvg-path.c index fe11b208..f1ef974f 100644 --- a/rsvg-path.c +++ b/rsvg-path.c @@ -115,6 +115,14 @@ rsvg_path_arc (RSVGParsePathCtx *ctx, double th0, th1, th_arc; int i, n_segs; + /* Check that neither radius is zero, since its isn't either + geometrically or mathematically meaningful and will + cause divide by zero and subsequent NaNs. We should + really do some ranged check ie -0.001 < x < 000.1 rather + can just a straight check again zero. + */ + if ((rx == 0.0) || (ry == 0.0)) return; + sin_th = sin (x_axis_rotation * (M_PI / 180.0)); cos_th = cos (x_axis_rotation * (M_PI / 180.0)); a00 = cos_th / rx; -- cgit v1.2.1