[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1855-g97277fc

[email protected] (Julian Smith) Wed, 13 Nov 2019 14:24:03 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  97277fcf0f70d482481ac329ce473e5687e7a935 (commit)
      from  6690c60c3e1be875134150fa4909bff0de7d583f (commit)

----------------------------------------------------------------------
commit 97277fcf0f70d482481ac329ce473e5687e7a935
Author: Julian Smith <[email protected]>
Date:   Wed Nov 13 13:51:27 2019 +0000

    Bug 701906: Fix duplicate call to tiff_from_filep() that caused leak of TIFF object.
    
    The code in tiff_rgb_print_page() did tfdev->tif = tiff_from_filep(), but
    then calls gdev_tiff_begin_page() which does the same thing, overwriting the
    original tfdev->tif.
    
    Also changed tiff12_print_page() as it looks to have the same problem.
    
    This fixes:
        ./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -sOutputFile=tmp -sDEVICE=tiff48nc ../bug-701906.pdf

diff --git a/devices/gdevtfnx.c b/devices/gdevtfnx.c
index 578e964..d9593cd 100644
--- a/devices/gdevtfnx.c
+++ b/devices/gdevtfnx.c
@@ -126,13 +126,6 @@ tiff12_print_page(gx_device_printer * pdev, gp_file * file)
     gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
     int code;
 
-    /* open the TIFF device */
-    if (gdev_prn_file_is_new(pdev)) {
-        tfdev->tif = tiff_from_filep(pdev, pdev->dname, file, tfdev->BigEndian, tfdev->UseBigTIFF);
-        if (!tfdev->tif)
-            return_error(gs_error_invalidfileaccess);
-    }
-
     code = gdev_tiff_begin_page(tfdev, file);
     if (code < 0)
         return code;
@@ -189,13 +182,6 @@ tiff_rgb_print_page(gx_device_printer * pdev, gp_file * file)
     gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
     int code;
 
-    /* open the TIFF device */
-    if (gdev_prn_file_is_new(pdev)) {
-        tfdev->tif = tiff_from_filep(pdev, pdev->dname, file, tfdev->BigEndian, tfdev->UseBigTIFF);
-        if (!tfdev->tif)
-            return_error(gs_error_invalidfileaccess);
-    }
-
     code = gdev_tiff_begin_page(tfdev, file);
     if (code < 0)
         return code;


Summary of changes:
 devices/gdevtfnx.c | 14 --------------
 1 file changed, 14 deletions(-)