diff options
author | Robin Watts <robin@ghostscript.com> | 2011-05-20 12:46:09 +0000 |
---|---|---|
committer | Robin Watts <robin@ghostscript.com> | 2011-05-20 12:46:09 +0000 |
commit | 0805588e9bcaec02b4eef4582db6ab23ae8ea1b1 (patch) | |
tree | 30319951029da6c5320209a7b2f3bdc8da52e3b8 | |
parent | c6341648ed83b1a3dde948bdf8bcf54a2f275fe5 (diff) |
Fix Bug 692216. Remove zero height traps from shadings.
The simplified file in Bug 692216 shows a division by zero error when
filling a trapezoid with zero height. The fix is simply to update
the code not to draw zero height traps.
This should be safe as any fill adjustment is done well before this point.
The cluster shows just one difference. Looking at it in a bmpcmp it does
look suspicious, but it's not clear whether it's a progression or a
regression. Ken informs me he's seen the same differences before with
unrelated changes, so perhaps it's an indeterminism.
The code seems more sensible this way round anyway.
-rw-r--r-- | gs/base/gxshade6.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gs/base/gxshade6.c b/gs/base/gxshade6.c index e45b6f3d6..535bf0ac7 100644 --- a/gs/base/gxshade6.c +++ b/gs/base/gxshade6.c @@ -893,7 +893,7 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4], fixed xright = (swap_axes ? pfs->rect.q.y : pfs->rect.q.x); vd_save; - if (ybot > ytop) + if (ybot >= ytop) return 0; # if NOFILL_TEST if (dbg_nofill) |