[cairo] [PATCH] gl: release context if creating image failed

Yuanhan Liu yuanhan.liu at linux.intel.com
Thu Jun 14 23:01:59 PDT 2012


On Thu, Jun 14, 2012 at 05:43:57PM +0300, Petr Kobalíček wrote:
> Hi,
> 
> aren't you accessing image->status after destroying the image?

Yes, since image->status stored the 'real error' we met while creating
image. Thus, that's the error we should report.


And oops, I just found this patch is against with Henry's tree. 

Henry, would you pick this minor fix?

Thanks,
Yuanhan Liu
> 
> On Wed, Jun 13, 2012 at 12:55 PM, Yuanhan Liu
> <yuanhan.liu at linux.intel.com> wrote:
> > Release gl context if the former image creating failed. Also let it
> > return the right status value from image->status
> >
> > Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
> > ---
> >  src/cairo-gl-operand.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
> > index 1368a86..bb341ab 100644
> > --- a/src/cairo-gl-operand.c
> > +++ b/src/cairo-gl-operand.c
> > @@ -589,7 +589,9 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
> >                                                        extents->height,
> >                                                        -1);
> >     if (unlikely (image->status)) {
> > +       cairo_int_status_t ignore = _cairo_gl_context_release(ctx, status);
> >        cairo_surface_destroy (image);
> > +       status = image->status;
> >        goto fail;
> >     }
> >
> > --
> > 1.7.7.6
> >
> > --
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list