[gs-commits] ghostpdl branch, master, updated. ghostpdl-9.02-634-ge776cc4

Robin Watts robin at ghostscript.com
Mon Oct 3 16:18:38 UTC 2011


The ghostpdl branch, master has been updated
       via  e776cc41b9da0a535adde126464d6af906b082ae (commit)
      from  3420c5c029771eee268d049fe9b6869221b18d48 (commit)

----------------------------------------------------------------------
commit e776cc41b9da0a535adde126464d6af906b082ae
Author: Robin Watts <Robin.Watts at artifex.com>
Date:   Mon Oct 3 17:15:53 2011 +0100

    Fix for Bug 692553; SEGV in fast thresholding halftoning code.
    
    Stupid C got the % operation wrong.
    
    In this instance, it gives an unexpected negative value causing out of
    bounds offsets. Simple fix is to offset by the period if it's negative.

diff --git a/gs/base/gxht_thresh.c b/gs/base/gxht_thresh.c
index 7002c3a..8984913 100644
--- a/gs/base/gxht_thresh.c
+++ b/gs/base/gxht_thresh.c
@@ -686,6 +686,8 @@ gxht_thresh_plane(gx_image_enum *penum, gx_ht_order *d_order,
             for (k = 0; k < vdi; k++) {
                 /* Get a pointer to our tile row */
                 dy = (penum->yci + k + penum->dev->band_offset_y) % thresh_height;
+                if (dy < 0)
+                    dy += thresh_height;
                 thresh_tile = threshold + d_order->width * dy;
                 /* Fill the buffer, can be multiple rows.  Make sure
                    to update with stride */


Summary of changes:
 gs/base/gxht_thresh.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)



More information about the gs-commits mailing list