b***@artifex.com
2017-01-16 18:50:15 UTC
http://bugs.ghostscript.com/show_bug.cgi?id=697483
Bug ID: 697483
Summary: Segfault with psdcmyk using -dGraphicsAlphaBits=4
-dTextAlphaBits=4 Altona_Technical
Product: Ghostscript
Version: master
Hardware: PC
OS: Windows NT
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: Graphics Library
Assignee: ghostpdl-***@artifex.com
Reporter: ***@artifex.com
QA Contact: gs-***@ghostscript.com
Word Size: ---
This turned up on the nightly run 1/15 and I am able to duplicate it on
Windows using:
gswin64c -sDEVICE=psdcmyk -o x-%d.psd -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
-r300 -Z: tests_private/comparefiles/Altona_Technical_v20_x4.pdf
Since I observed the segfault on page 7, I determined that it happens very
quickly if I add -dFirstPage=7
With a debug build I see the segfault is in i_free_object when called from
gx_default_copy_alpha when trying to free "lout". This is caused by the
earlier call in line 395 to:
code = (*dev_proc(dev, get_bits)) (dev, ry, lin, &line);
which writes past the end of "lin" area overwriting the buffer allocated for
"lout".
This happens on the very first call to gx_default_copy_alpha. Note at this
point the 'dev' is the pattern_accumulator and its target is image24, but
both the pattern_accumulator device and the image24 device have is_planar set
to 1 and the get_bits_rectangle directs to mem_planar_get_bits_rectangle.
The problem is that "in_size" from gx_device_raster for planar devices is for
a plane, not for all planes, so when the mem_planar_get_bits_rectangle returns
3-bytes per pixel, it overflows (by a lot).
Bug ID: 697483
Summary: Segfault with psdcmyk using -dGraphicsAlphaBits=4
-dTextAlphaBits=4 Altona_Technical
Product: Ghostscript
Version: master
Hardware: PC
OS: Windows NT
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: Graphics Library
Assignee: ghostpdl-***@artifex.com
Reporter: ***@artifex.com
QA Contact: gs-***@ghostscript.com
Word Size: ---
This turned up on the nightly run 1/15 and I am able to duplicate it on
Windows using:
gswin64c -sDEVICE=psdcmyk -o x-%d.psd -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
-r300 -Z: tests_private/comparefiles/Altona_Technical_v20_x4.pdf
Since I observed the segfault on page 7, I determined that it happens very
quickly if I add -dFirstPage=7
With a debug build I see the segfault is in i_free_object when called from
gx_default_copy_alpha when trying to free "lout". This is caused by the
earlier call in line 395 to:
code = (*dev_proc(dev, get_bits)) (dev, ry, lin, &line);
which writes past the end of "lin" area overwriting the buffer allocated for
"lout".
This happens on the very first call to gx_default_copy_alpha. Note at this
point the 'dev' is the pattern_accumulator and its target is image24, but
both the pattern_accumulator device and the image24 device have is_planar set
to 1 and the get_bits_rectangle directs to mem_planar_get_bits_rectangle.
The problem is that "in_size" from gx_device_raster for planar devices is for
a plane, not for all planes, so when the mem_planar_get_bits_rectangle returns
3-bytes per pixel, it overflows (by a lot).
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are receiving this mail because:
You are the QA Contact for the bug.