Bug 691549 - Seg Fault with FT API
Summary: Seg Fault with FT API
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Font API (show other bugs)
Version: master
Hardware: All All
: P1 blocker
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
: 691527 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-11 17:24 UTC by Michael Vrhel
Modified: 2010-08-15 09:45 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
Bug691527_simple.pdf (43.27 KB, application/pdf)
2010-08-11 17:24 UTC, Michael Vrhel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Vrhel 2010-08-11 17:24:21 UTC
Created attachment 6645 [details]
Bug691527_simple.pdf

This bug is coming from a split of 691527 into two bugs.  The simplified file that will be attached has a seg fault with FT_BRIDGE but renders fine without the FT_BRIDGE.  fapi_finish_render_aux line 1753 does a call to gx_image_fill_mask to fill a mask image with a pattern.  

The pattern is a clist pattern.  The actual crash occurs in gx_dc_pattern_fill_rectangle in line 308 during.  However, I believe the problem is somewhere else since we never even get to this part of the code without Free type until clist reading phase -- and the output is fine.  The above crash occurs when we are still in clist writing phase for the main document. 

Command line is

gswin32c -P  -Z: -r600 -dBandHeight=128  -sDEVICE=ppmraw -o test.ppm bug691527_simple.pdf
Comment 1 Michael Vrhel 2010-08-11 17:30:51 UTC
*** Bug 691527 has been marked as a duplicate of this bug. ***
Comment 2 Chris Liddell (chrisl) 2010-08-11 20:08:29 UTC
The problem is that the way the way glyphs are/should be filled with Type 2 patterns (maybe type 1, too?) is that the glyph is not rendered, but intepreted to a path, which is then used as a clip through which to render the pattern.

At the moment, the FAPI code only checks for a stroked font, or a charpath operation, and is missing the fact that, in this case, we want path, even though the original operation is a "normal" show-type operation. It creates a bitmap and passes that to the mask rendering code - unfortantely, everything else has been setup to accept a path, hence the crash.

Hopefully, it won't be too difficult to revise FAPI to correctly produce an outline that can be used for clipping in these cases - I'm too tired to look any further right now......
Comment 3 Chris Liddell (chrisl) 2010-08-15 09:45:12 UTC
fixed with r11634.