[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1847-g375adf8

[email protected] (Julian Smith) Mon, 11 Nov 2019 15:04:22 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  375adf84b0d511522a4f7c2e13dfb81f00d75d53 (commit)
       via  33c5f8780d75332e5330b94686995aa558e079a5 (commit)
       via  e3fee39b0d1ef26149ea885efcf9701719305701 (commit)
       via  97d08f44140b4236e7d224c42b0e288dbccb8b79 (commit)
      from  aad7bcab6a3aedc4e2bfecd7b1e6bf893c299d0e (commit)

----------------------------------------------------------------------
commit 375adf84b0d511522a4f7c2e13dfb81f00d75d53
Author: Julian Smith <[email protected]>
Date:   Mon Nov 11 13:45:59 2019 +0000

    Coverity p11408:350214: fix use of uninitialised 'file'.

diff --git a/base/gpmisc.c b/base/gpmisc.c
index 8b67cb2..fd4bc5e 100644
--- a/base/gpmisc.c
+++ b/base/gpmisc.c
@@ -800,7 +800,7 @@ gp_open_scratch_file_rm(const gs_memory_t *mem,
                         char              *fname,
                         const char        *mode)
 {
-    gp_file *file;
+    gp_file *file = NULL;
     gs_lib_ctx_t *ctx = mem->gs_lib_ctx;
     gs_fs_list_t *fs = ctx->core->fs;
 

----------------------------------------------------------------------
commit 33c5f8780d75332e5330b94686995aa558e079a5
Author: Julian Smith <[email protected]>
Date:   Mon Nov 11 13:41:29 2019 +0000

    Coverity p11408:350217: avoid memcpy() with same buffers.

diff --git a/pcl/pcl/pcindxed.c b/pcl/pcl/pcindxed.c
index f5ebc75..25637b7 100644
--- a/pcl/pcl/pcindxed.c
+++ b/pcl/pcl/pcindxed.c
@@ -208,7 +208,12 @@ unshare_indexed_cspace(pcl_cs_indexed_t ** ppindexed)
            pindexed->palette.size);
     memcpy(pnew->pen_widths, pindexed->pen_widths,
            num_entries * sizeof(float));
-    memcpy(pnew->norm, pindexed->norm, 3 * sizeof(pindexed->norm[0]));
+
+    /* Coverity thinks next memcpy() might need to be memmove(), so we
+    explicitly check for the buffers being equal. */
+    if (pnew->norm != pindexed->norm) {
+        memcpy(pnew->norm, pindexed->norm, 3 * sizeof(pindexed->norm[0]));
+    }
 
     /* Coverity thinks next memcpy() might need to be memmove(), so we
     explicitly check for the buffers being equal. */

----------------------------------------------------------------------
commit e3fee39b0d1ef26149ea885efcf9701719305701
Author: Julian Smith <[email protected]>
Date:   Mon Nov 11 12:44:26 2019 +0000

    Coverity p11408:350197: fix issue by initialising 'file' to NULL.

diff --git a/base/gpmisc.c b/base/gpmisc.c
index 22b1484..8b67cb2 100644
--- a/base/gpmisc.c
+++ b/base/gpmisc.c
@@ -743,7 +743,7 @@ gp_open_printer(const gs_memory_t *mem,
                       char         fname[gp_file_name_sizeof],
                       int          binary_mode)
 {
-    gp_file *file;
+    gp_file *file = NULL;
     gs_lib_ctx_t *ctx = mem->gs_lib_ctx;
     gs_fs_list_t *fs = ctx->core->fs;
 

----------------------------------------------------------------------
commit 97d08f44140b4236e7d224c42b0e288dbccb8b79
Author: Julian Smith <[email protected]>
Date:   Mon Nov 11 11:17:57 2019 +0000

    Coverity p11408:350178: Stop coverity overflow warning about array of floats.

diff --git a/base/gsicc_create.c b/base/gsicc_create.c
index 5f8df5a..0579b4c 100644
--- a/base/gsicc_create.c
+++ b/base/gsicc_create.c
@@ -1759,7 +1759,7 @@ gsicc_create_abc_merge(gsicc_lutatob *atob_parts, gs_matrix3 *matrixLMN,
        to the mapping of X=Y by the identity table.  If there are b_curves
        these have an output that is 16 bit. */
     if (atob_parts->b_curves == NULL) {
-        scale_matrix(&(atob_parts->matrix->cu.u), 2.0);
+        scale_matrix((float*) &atob_parts->matrix, 2.0);
     }
     return 0;
 }


Summary of changes:
 base/gpmisc.c       | 4 ++--
 base/gsicc_create.c | 2 +-
 pcl/pcl/pcindxed.c  | 7 ++++++-
 3 files changed, 9 insertions(+), 4 deletions(-)