[poppler] Stroke color of type 3 fonts

Jeff Muizelaar jeff at infidigm.net
Wed Jun 18 12:10:25 PDT 2008


On Wed, Jun 18, 2008 at 11:39:20AM -0700, Michael Vrable wrote:
> I'm now seeing a crash with some PDFs in evince, and reverting this 
> patch fixes them.  The error I'm seeing is
> 
>     evince: cairo-pattern.c:679: cairo_pattern_destroy: Assertion 
>     `((*&(&pattern->ref_count)->ref_count) > 0)' failed.
> 
> My guess is that reference counts are not being updated on 
> fill_pattern/stroke_pattern when they are temporarily changed; if the 
> Type3 font happens to explicitly set the color, then the reference 
> counts can be corrupted.
> 
> Additionally, I believe it may be possible to have a Type3 font nested 
> inside another Type3 font, but using a single member variable to save 
> the old stroke color is not reentrant.
> 
> Fortunately, calls to beginType3Char/endType3Char are already wrapped in 
> calls to saveState/restoreState, so we don't need to save and restore 
> the stroke color in the Cairo backend--that will happen automatically.  
> This allows the code to be simplified.
> 
> We should still set the stroke pattern to the current fill pattern.  Do 
> that, but with proper reference counting.
> 
> Patch is attached.

Looks good to me. 

Can someone commit it? I haven't fixed my commit access otherwise I'd
commit it myself.

-Jeff


More information about the poppler mailing list