[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1813-g67b4efc

[email protected] (Robin Watts) Tue, 5 Nov 2019 15:32:00 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  67b4efc310af7bf9d30f84a70c6b9858ab138e3d (commit)
       via  02c566b4b5f3f60ff8ebd7f4523722c39c2d72e7 (commit)
      from  f38c6b08c6582872af25fc669a5fd3bde9f32753 (commit)

----------------------------------------------------------------------
commit 67b4efc310af7bf9d30f84a70c6b9858ab138e3d
Author: Robin Watts <[email protected]>
Date:   Tue Nov 5 14:59:56 2019 +0000

    Bug 701809: Fix out oob access in transform_pixel_region.
    
    When collating pixels to write out using copy_color,
    we can only write within our array. Clip maxx/minx accordingly.

diff --git a/base/gdevdflt.c b/base/gdevdflt.c
index f1d1bb8..964f0aa 100644
--- a/base/gdevdflt.c
+++ b/base/gdevdflt.c
@@ -1876,6 +1876,11 @@ transform_pixel_region_render_portrait(gx_device *dev, gx_default_transform_pixe
         }
         out = state->line;
 
+        if (minx < 0)
+            minx = 0;
+        if (maxx > dev->width)
+            maxx = dev->width;
+
         if (pending_left < minx)
             pending_left = minx;
         else if (pending_left > maxx)

----------------------------------------------------------------------
commit 02c566b4b5f3f60ff8ebd7f4523722c39c2d72e7
Author: Robin Watts <[email protected]>
Date:   Tue Nov 5 14:54:22 2019 +0000

    Memento: Unlock a block with valgrind before checking it.
    
    This avoids false positives on closedown.

diff --git a/base/memento.c b/base/memento.c
index d5ee75b..3098b00 100644
--- a/base/memento.c
+++ b/base/memento.c
@@ -1572,9 +1572,15 @@ static int Memento_nonLeakBlocksLeaked(void)
     Memento_BlkHeader *blk = memento.used.head;
     while (blk)
     {
-        if ((blk->flags & Memento_Flag_KnownLeak) == 0)
+        Memento_BlkHeader *next;
+        int leaked;
+        VALGRIND_MAKE_MEM_DEFINED(blk, sizeof(*blk));
+        leaked = ((blk->flags & Memento_Flag_KnownLeak) == 0);
+        next = blk->next;
+        VALGRIND_MAKE_MEM_DEFINED(blk, sizeof(*blk));
+        if (leaked)
             return 1;
-        blk = blk->next;
+        blk = next;
     }
     return 0;
 }
@@ -1589,7 +1595,6 @@ void Memento_fin(void)
             Memento_listBlocks();
 #ifdef MEMENTO_DETAILS
             fprintf(stderr, "\n");
-            Memento_listBlockInfo();
 #endif
             Memento_breakpoint();
         }


Summary of changes:
 base/gdevdflt.c |  5 +++++
 base/memento.c  | 11 ++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)