[cairo] CAIRO_STATUS_NO_MEMORY when passing incorrect scaling

Peter Clifton pcjc2 at cam.ac.uk
Thu Jan 1 16:37:17 PST 2009


On Thu, 2009-01-01 at 14:42 -0500, Behdad Esfahbod wrote:
> Paolo Bonzini wrote:
> > Behdad Esfahbod wrote:
> >> Peter Clifton wrote:
> >>> Hi guys,
> >>>
> >>> I noticed, as I was debugging some drawing code, that after a certain
> >>> error in my code, all further cairo output was stopped.
> >>>
> >>> I tracked the problem down to an incorrect scale factor I was passing to
> >>> cairo_scale(), I was in fact passing the X scale factor as 0. due to a
> >>> corner case being hit at a certain zoom factor.
> >> Yeah, that's a bug that we need to fix.  Scaling down to zero should not be an
> >> error.
> > 
> > If anything, my invalid-size-error branch should change this to an
> > invalid size error.  I agree that the error should be in the context...
> 
> The context already goes into CAIRO_STATUS_INVALID_MATRIX.  As I said in the
> other mail, the NO_MEMORY is a side effect of how nil objects work internally
> right now.

Aha.

Right after the failed operation, I set cairo_matrix_identity() on the
context, and still, further drawing was not functional on that context.
Is that considered a known bug, or something to be fixed in the future?


-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



More information about the cairo mailing list