Bug 691549

Summary: Seg Fault with FT API
Product: Ghostscript Reporter: Michael Vrhel <michael.vrhel>
Component: Font APIAssignee: Chris Liddell (chrisl) <chris.liddell>
Status: RESOLVED FIXED    
Severity: blocker CC: ken.sharp, ray.johnston
Priority: P1    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: Bug691527_simple.pdf

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.