[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1843-gaad7bca

[email protected] (Chris Liddell) Mon, 11 Nov 2019 11:47:44 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  aad7bcab6a3aedc4e2bfecd7b1e6bf893c299d0e (commit)
       via  2de09275898086e903a19812fd78e73381f7e71e (commit)
      from  c198ac5dcb26fadc53074525cabb413e5395cdba (commit)

----------------------------------------------------------------------
commit aad7bcab6a3aedc4e2bfecd7b1e6bf893c299d0e
Author: Chris Liddell <[email protected]>
Date:   Mon Nov 11 10:21:13 2019 +0000

    Better solution for commit 68aeff88e95c
    
    This is a simplified (and fixed) solution for the problem addressed in commit
    68aeff88e95c: instead of assiging to the 'fixed' type, then converting to
    ufixed (wrongly, in the original commit), just go straight to ufixed.
    
    This solves coverity issues: 350493 and 350492

diff --git a/base/gxhintn.c b/base/gxhintn.c
index 0458157..dc28c00 100644
--- a/base/gxhintn.c
+++ b/base/gxhintn.c
@@ -467,14 +467,9 @@ 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 tc = (x > y ? x : y);
-    ufixed c;
-
-    /* Protect against signed overflow -
-     * note max_import_coord below is unsigned
-     */
-    c = (ufixed)(tc < 0 ? -tc : c);
+{
+    ufixed x = any_abs(xx), y = any_abs(yy);
+    ufixed c = (x > y ? x : y);
 
     while (c >= self->max_import_coord) {
         /* Reduce the precision of ctmf to allow products to fit into 32 bits : */

----------------------------------------------------------------------
commit 2de09275898086e903a19812fd78e73381f7e71e
Author: Chris Liddell <[email protected]>
Date:   Mon Nov 11 10:42:11 2019 +0000

    Bug 695873: reverse search to auto-set GenericResourceDir
    
    A -I path like:
    
    /path/to/Resources/share/ghostscript/9.15/Resource/Init
    
    Would cause us to wrongly set GenericResourceDir and the ICCProfilesDir because
    in both cases we'd search the path for the string 'Resource', and end up using:
    
    /path/to/Resource
    
    To work better, this uses the new and non-standard rsearch operator to search
    the path backwards.
    
    I opted not to include the trailing directory separator at this stage because
    that complicates matters with platforms that uses different directory
    separators (Unix vs Windows vs OpenVMS, for example)

diff --git a/Resource/Init/gs_lev2.ps b/Resource/Init/gs_lev2.ps
index 0fd4164..8c41aba 100644
--- a/Resource/Init/gs_lev2.ps
+++ b/Resource/Init/gs_lev2.ps
@@ -660,7 +660,7 @@ currentuserparams /WaitTimeout known
     % Search for valid (iccprofiles) directory as a sibling to (Resource)
     % and set it as a default if found.
     LIBPATH {
-      (Resource) search {
+      (Resource) rsearch {
         exch pop exch pop (iccprofiles) concatstrings
         .file_name_separator concatstrings
         dup (default_gray.icc) concatstrings status {
diff --git a/Resource/Init/gs_res.ps b/Resource/Init/gs_res.ps
index 068514b..5559e6a 100644
--- a/Resource/Init/gs_res.ps
+++ b/Resource/Init/gs_res.ps
@@ -284,7 +284,7 @@ systemdict begin
     dup .file_name_current eq {
       pop
     } {
-      (Resource) search {
+      (Resource) rsearch {
         exch concatstrings
         exch pop
         .file_name_separator concatstrings exit


Summary of changes:
 Resource/Init/gs_lev2.ps |  2 +-
 Resource/Init/gs_res.ps  |  2 +-
 base/gxhintn.c           | 11 +++--------
 3 files changed, 5 insertions(+), 10 deletions(-)