Summary: | Division by Zero at base/gxclrast.c:1145 in clist_playback_band | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Suhwan <prada960808> |
Component: | General | Assignee: | Ray Johnston <ray.johnston> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chris.liddell |
Priority: | P4 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: | poc |
Description
Suhwan
2019-11-05 17:15:46 UTC
With HEAD (commit 1159afbcad927e1a32008b0ab87e257fc21da8e2) on Windows 32-bit with: debugbin/gswin32c -sDEVICE=devicen -dTextAlphaBits=4 -Z: -o x.devn poc.pdf I get: GPL Ghostscript GIT PRERELEASE 9.51: c:\artifex\cgit\ghostpdl\base\gxclrast.c(2132): Bad op fe band y0 = 264 file pos 4096 buf pos 702/4096 On 64-bit Ubuntu I get similar: GPL Ghostscript GIT PRERELEASE 9.51: ./base/gxclrast.c(2132): Bad op fe band y0 = 542 file pos 4096 buf pos 667/4096 but then this is followed by: Floating point exception (core dumped) Running under gdb, the divide by zero is seen to be: #0 in clist_playback_band (playback_action=playback_action_render, cdev=0x22ec088, s=0x7fffffff69a0, target=0x298fb18, x0=0, y0=813, mem=0x2258978) at ./base/gxclrast.c:1145 with state_slot pointing to a bogus tile: {head = {size = 567232, depth = 0}, width = 0, height = 0, shift = 0, raster = 0, id = 0, x_reps = 0 '\000', y_reps = 0 '\000', rep_shift = 0, index = 0, num_bands = 0, num_planes = 0 '\000'} Taking this, and will test on linux 64-bit when fixed. Fixed in commit 372c862f2050d82248316f54156e5bb33dd7520a Author: Ray Johnston <ray.johnston@artifex.com> Date: Fri Jan 3 09:56:29 2020 -0800 The devicen device used to define 32-bit depth, but 0 components and no standard process colors or names. This confused the pdf14 device into writing a clist with 1-component (gray), but then because the icc_profile had 4 components, would try and use 4 component when reading. Fix by making it 32-bit CMYK, and also fix to write a valid PCX by converting the 32-bit CMYK to 24-bit RGB on output. PCX cannot handle 32-bit CMYK. Prior to this, 32-bit CMYK would fail showpage with a rangecheck error. |