[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1829-g68aeff8

[email protected] (Chris Liddell) Fri, 8 Nov 2019 07:56:26 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  68aeff88e95ccfd1af430fe180597d624ad9f47e (commit)
       via  713645137a2fc483e5509bfd0f92d7311faeb614 (commit)
      from  6c3af6e12e4448b519d2b48c2047c0c83b3cf082 (commit)

----------------------------------------------------------------------
commit 68aeff88e95ccfd1af430fe180597d624ad9f47e
Author: Chris Liddell <[email protected]>
Date:   Thu Nov 7 10:08:35 2019 +0000

    Old Type 1 hinter: protect against signed overflow
    
    To avoid overflow during hinting, we tweak the balance of the size of the
    coordinates and the scaling in the hinter (this is only dealing with coords
    so large that hinting is largely pointless anyway).
    
    But the code that does that didn't protect against signed overflow in the
    starting coordinates.
    
    This is a naive protection to prevent an infinite (or near so) loop, but
    a) it's old code that shouldn't be in use anymore, and b) in practice it will
    make no difference to rendering with coordinates that large.

diff --git a/base/gxhintn.c b/base/gxhintn.c
index 1e3e429..0458157 100644
--- a/base/gxhintn.c
+++ b/base/gxhintn.c
@@ -468,7 +468,13 @@ static void t1_hinter__compute_rat_transform_coef(t1_hinter * self)
 
 static inline void t1_hinter__adjust_matrix_precision(t1_hinter * self, fixed xx, fixed yy)
 {   fixed x = any_abs(xx), y = any_abs(yy);
-    fixed c = (x > y ? x : y);
+    fixed tc = (x > y ? x : y);
+    ufixed c;
+
+    /* Protect against signed overflow -
+     * note max_import_coord below is unsigned
+     */
+    c = (ufixed)(tc < 0 ? -tc : c);
 
     while (c >= self->max_import_coord) {
         /* Reduce the precision of ctmf to allow products to fit into 32 bits : */

----------------------------------------------------------------------
commit 713645137a2fc483e5509bfd0f92d7311faeb614
Author: Chris Liddell <[email protected]>
Date:   Wed Nov 6 14:17:33 2019 +0000

    Some more transparency ops doc tweaks

diff --git a/doc/Language.htm b/doc/Language.htm
index 5f112a1..d8f9deb 100644
--- a/doc/Language.htm
+++ b/doc/Language.htm
@@ -463,6 +463,10 @@ Ghostscript's model generalizes that of PDF 1.4 in that Ghostscript
 maintains separate alpha and mask values for opacity and shape, rather than
 a single value with a Boolean that says whether it represents opacity or
 shape.</p>
+<p>
+What follows is a subset of all the custom operators related to transparency, but
+covers the most useful, most common requirements.
+</p>
 
 <h5><a name="Transparency_graphics_state_operators"></a>Graphics state
 operators</h5>
@@ -495,23 +499,43 @@ the blending mode is <code>/Compatible</code>.</dd>
 </dl>
 
 <dl>
+<dt><code>- .currentblendmode &lt;modename&gt;</code></dt>
+<dd>Returns the graphics state blend mode on the stack.
+</dl>
+
+<dl>
 <dt><code>&lt;0..1&gt; .setopacityalpha -</code></dt>
 <dd>Sets the opacity alpha value in the graphics state.
 The initial opacity alpha value is 1.</dd>
 </dl>
 
 <dl>
+<dt><code>- .currentopacityalpha &lt;0..1&gt;</code></dt>
+<dd>Returns the graphics state opacity alpha on the stack.</dd>
+</dl>
+
+<dl>
 <dt><code>&lt;0..1&gt; .setshapealpha -</code></dt>
 <dd>Sets the shape alpha value in the graphics state.
 The initial shape alpha value is 1.</dd>
 </dl>
 
 <dl>
+<dt><code>- .currentshapealpha &lt;0..1&gt;</code></dt>
+<dd>Returns the graphics state shape alpha on the stack.</dd>
+</dl>
+
+<dl>
 <dt><code>&lt;bool&gt; .settextknockout -</code></dt>
 <dd>Sets the text knockout flag in the graphics state.
 The initial value of the text knockout flag is <code>true</code>.</dd>
 </dl>
 
+<dl>
+<dt><code>- .currenttextknockout &lt;bool&gt;</code></dt>
+<dd>Returns the graphics state text knockout on the stack..</dd>
+</dl>
+
 <h5><a name="Transparency_rendering_stack_operators"></a>Rendering stack
 operators</h5>
 


Summary of changes:
 base/gxhintn.c   |  8 +++++++-
 doc/Language.htm | 24 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)