[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1791-gaadb53e

[email protected] (Ken Sharp) Fri, 1 Nov 2019 10:26:49 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  aadb53eb834b3def3ef68d78865ff87a68901804 (commit)
      from  9c196bb7f6873b4fe43a649fc87cba363c6af8e5 (commit)

----------------------------------------------------------------------
commit aadb53eb834b3def3ef68d78865ff87a68901804
Author: Ken Sharp <[email protected]>
Date:   Fri Nov 1 10:26:44 2019 +0000

    Tiffsep and Tiffsep1 - abort on multi-page input wtithout %d OutputFile
    
    Bug #701821 "Segmentation fault at tiff//libtiff/tif_dirinfo.c:513 in TIFFFindField"
    
    The tiffsep and tiffsep1 only set 'code' to an error when an attempt is
    made to write a second output file without using %d in the OutputFile
    specification.
    
    This causes problems later when attempting to process the files. The
    devices should exit without trying to further process the pages under
    these conditions and this commit returns immediately on error.
    
    The other devices like this already return immediately on error, it
    looks like the code here was copied between  devices without realising
    that the tiffsep and tiffsep1 devices didn't exit when the error
    condition was set.

diff --git a/devices/gdevtsep.c b/devices/gdevtsep.c
index b5ea163..bb905b7 100644
--- a/devices/gdevtsep.c
+++ b/devices/gdevtsep.c
@@ -2365,6 +2365,7 @@ tiffsep_print_page(gx_device_printer * pdev, gp_file * file)
                 "\nUse of the %%d format is required to output more than one page to tiffsep.\n"
                 "See doc/Devices.htm#TIFF for details.\n\n");
        code = gs_note_error(gs_error_ioerror);
+       goto done;
     }
     /* Write the page directory for the CMYK equivalent file. */
     if (!tfdev->comp_file) {
@@ -2726,6 +2727,7 @@ tiffsep1_print_page(gx_device_printer * pdev, gp_file * file)
                 "\nUse of the %%d format is required to output more than one page to tiffsep1.\n"
                 "See doc/Devices.htm#TIFF for details.\n\n");
        code = gs_note_error(gs_error_ioerror);
+       goto done;
     }
     /* If the output file is on disk and the name contains a page #, */
     /* then delete the previous file. */


Summary of changes:
 devices/gdevtsep.c | 2 ++
 1 file changed, 2 insertions(+)