diff options
Diffstat (limited to 'rsvg-path.c')
-rw-r--r-- | rsvg-path.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; |