[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1849-g592fb03

[email protected] (Julian Smith) Mon, 11 Nov 2019 16:58:41 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  592fb032180aac0fc22a7c860ef116b38da8ca71 (commit)
       via  7da60037b788bec4217f6ee7017e238f541714ae (commit)
       via  658e14023fa84232c569ecc5528b77fd35bcf290 (commit)
       via  11f8439f49a3704bb4506e02382a0e697e5edf8e (commit)
      from  a1747b9267b4aac28e256820c5cea37af299af86 (commit)

----------------------------------------------------------------------
commit 592fb032180aac0fc22a7c860ef116b38da8ca71
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 7da60037b788bec4217f6ee7017e238f541714ae
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 658e14023fa84232c569ecc5528b77fd35bcf290
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 11f8439f49a3704bb4506e02382a0e697e5edf8e
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..6965db5 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(-)