[cairo] Fix crash - SurfacePatternDrawFunc in cairo-quartz-surface.c

Baz brian.ewins at gmail.com
Fri Apr 6 04:59:53 PDT 2007


On 06/04/07, Mox Soini <mox at iki.fi> wrote:
> Otherwise it seems to be working fine, except when the code was
> implemented in OOo to take advantage of native images as source
> surface (using CGBitmapContext), the SurfacePatternDrawFunc() crashed.
>
> This was caused by _init_pattern_with_snapshot() failing in
> _cairo_quartz_cairo_repeating_surface_pattern_to_quartz()

The last bit of the patch, where the you fallback from the snapshot
error, doesnt seem quite right. It'd be good to have a testcase that
reproduces your crash so we can see what's actually going wrong there?
At a guess the original error is going to be happening something like
this:

_init_pattern_with_snapshot ->
_cairo_surface_snapshot ->
_cairo_surface_fallback_snapshot ->
_cairo_surface_acquire_source_image ->
_cairo_quartz_surface_acquire_source_image ->
_cairo_quartz_get_image
... and then hits one of the 'unsupported' image types. If that is
what's caused the problem, I'm curious how we managed to get an
incompatible image type in the pattern, and whether we could fix that
underlying problem instead. (similar problems with xlib are on the
roadmap).

Cheers,
Baz


More information about the cairo mailing list