[gs-commits] ghostpdl branch, gs9.28-temp-for-testing, updated. gs9.28-temp-for-testing-tag-2-ge02f9d6

[email protected] (Robin Watts)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, gs9.28-temp-for-testing has been updated
  discards  5e538ae744ce9b0089b67b846a52802099ec0f40 (commit)
       via  e02f9d69ad559618dbae1e3212f7705a451c1610 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (5e538ae744ce9b0089b67b846a52802099ec0f40)
            \
             N -- N -- N (e02f9d69ad559618dbae1e3212f7705a451c1610)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

----------------------------------------------------------------------
commit e02f9d69ad559618dbae1e3212f7705a451c1610
Author: Robin Watts <[email protected]>
Date:   Fri Aug 23 15:06:17 2019 +0100

    Fix deep color transparency issue.
    
    Fix overflow in art_pdf_composite_knockout_16, seen in:
    
       tests_private/comparefiles/Bug690546.pdf.psdcmyk16.72.0

diff --git a/base/gdevp14.c b/base/gdevp14.c
index 5e32683..18211aa 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -4878,7 +4878,6 @@ pdf14_begin_transparency_group(gx_device *dev,
     if_debug0m('v', dev->memory, "[v]Transparency group color space update\n");
     if (code < 0)
         return code;
-    /* FIXME: deep */
     code = pdf14_push_transparency_group(pdev->ctx, &rect, isolated, ptgp->Knockout,
                                          (uint16_t)floor (65535 * alpha + 0.5),
                                          (uint16_t)floor (65535 * pgs->shape.alpha + 0.5),
diff --git a/base/gxblend.c b/base/gxblend.c
index f3bf38d..6756613 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -2524,7 +2524,8 @@ art_pdf_composite_knockout_16(uint16_t *gs_restrict dst,
                               pdf14_device *p14dev)
 {
     uint16_t src_shape = src[n_chan];
-    int i, tmp;
+    int i;
+    unsigned int tmp;
 
     if (blend_mode == BLEND_MODE_Normal) {
         /* Do simple compositing of source over backdrop */
@@ -2542,14 +2543,17 @@ art_pdf_composite_knockout_16(uint16_t *gs_restrict dst,
             tmp = (65535 - dst_alpha) * src_shape + 0x8000;
             result_alpha = dst_alpha + ((tmp + (tmp >> 16)) >> 16);
 
-            if (result_alpha != 0)
+            if (result_alpha != 0) {
+                dst_alpha += dst_alpha>>15;
                 for (i = 0; i < n_chan; i++) {
                     /* todo: optimize this - can strength-reduce so that
                        inner loop is a single interpolation */
-                    tmp = dst[i] * dst_alpha * (65535 - src_shape) +
-                        ((int)src[i]) * 65535 * src_shape + (result_alpha << 15);
-                    dst[i] = tmp / (result_alpha * 65535);
+                    tmp = dst[i] * dst_alpha;
+                    tmp = (tmp>>16) * (65535 - src_shape) +
+                           src[i] * src_shape + (result_alpha>>1);
+                    dst[i] = tmp / result_alpha;
                 }
+            }
             dst[n_chan] = result_alpha;
         }
     } else {


Summary of changes:
 base/gdevp14.c | 1 -
 base/gxblend.c | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.