[cairo] OOM handling in _cairo_gstate_init_copy()

Owen Taylor otaylor at redhat.com
Fri Jan 14 10:32:07 PST 2005


The handling of out-of-memory in _cairo_gstate_init_copy() looks
like it needs some checking over; the code doesn't seem to 
handle in early bailout, members like gstate->font and
gstate->clip.region have been copied over from the values of
other but not duplicated/referenced.

I think it needs to be rewritten to do all the allocation upfront
and only start updating the members of gstate when everything
succeeds.

Regards,
					Owen

(Also, OOM handling for gstate->pattern looks wrong throughout
the file; the code assumes pattern != NULL even for _fini).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050114/32029eb7/attachment.pgp


More information about the cairo mailing list