[gs-bugs] [Bug 690308] New: segmentation fault while processing masked images

bugs.ghostscript.com-bugzilla-daemon at ghostscript.com bugs.ghostscript.com-bugzilla-daemon at ghostscript.com
Thu Feb 26 07:33:58 PST 2009


           Summary: segmentation fault while processing masked images
           Product: Ghostscript
           Version: 8.63
          Platform: PC
               URL: http://dev.innews.gr/pdf_tiff/forps/ghostscript/
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P4
         Component: PDF Interpreter
        AssignedTo: alex.cherepanov at artifex.com
        ReportedBy: agis at anadelta.com
         QAContact: gs-bugs at ghostscript.com
                CC: aagiss at gmail.com

We encountered a segmentation fault while trying to process some pdf files with
ghostscript while Acrobat Reader shows them fine.
we fixed the warnings with no success. 
we splitted the multipage pdf to single pages and it worked ok for every page
Files can be located at:

During the debugging proccess we created some pdfs with single images
(background/foreground+mask for foreground) and
for some images it worked while for others we got a segmentation fault. 
Compressed and decompressed versions of a failing file can be found at:

Converting the page to A4 dimensions seem to fix the problem. 

we are not sure if issue1 and issue2 are related however we found the following
that seems to be a bug:
(for_pattern < 2 || nbytes < 512000 ?
        (code = psdf_setup_lossless_filters((gx_device_psdf *) pdev,
            &piw->binary[0], (gs_pixel_image_t *)pim, false)) :
        (code = psdf_setup_image_filters((gx_device_psdf *) pdev,
            &piw->binary[0], (gs_pixel_image_t *)pim, NULL, NULL, false, false))
in our case, for one image that worked nbytes was < 512000 and for
notworking.pdf nbytes was > 512000 in which case we go to
psdf_setup_image_filters(gx_device_psdf * pdev, psdf_binary_writer * pbw,
             gs_pixel_image_t * pim, const gs_matrix * pctm,
             const gs_imager_state * pis, bool lossless, bool in_line)
notice that lossless is false and pis is NULL because of the call
gdevpsdi.c:614 setup_image_compression(pbw, &params, pim, pis, lossless);
gdevpsdi.c:330 code = choose_DCT_params((gx_device *)pbw->dev, pcs, pis, &list,
&param, st);
gdevpsdi.c:149 convert_color((gx_device *)&mdev, pcs, pis, &cc, c[3]);
gdevpsdi.c:104 code = pcs->type->remap_color(cc, pcs, &dc, pis, pdev,
gxcmap.c:758 gx_remap_concrete_rgb(fred, fgreen, fblue, pdc, pis, dev, select);
which is a macro defined as: ((pis)->cmap_procs->map_rgb)(cr, cg, cb, pdc, pis,
dev, select)
but pis is NULL so we get a segmentation fault

------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the gs-bugs mailing list