return NULL;
return CAIRO_STATUS_NO_MEMORY;
_cairo_glitz_surface_get_image (void *abstract_surface){    cairo_glitz_surface_t *surface = abstract_surface;    cairo_image_surface_t *image;    char *pixels;    int width, height;    cairo_format_masks_t format;    glitz_buffer_t *buffer;    glitz_pixel_format_t pf;    if (surface->pattern.type != CAIRO_PATTERN_SURFACE) {	cairo_box_t box;	box.p1.x = box.p1.y = 0;	box.p2.x = surface->pattern_box.p2.x;	box.p2.y = surface->pattern_box.p2.y;		return _cairo_pattern_get_image (&surface->pattern, &box);    }    width = glitz_surface_get_width (surface->surface);    height = glitz_surface_get_height (surface->surface);    if (surface->format->type == GLITZ_FORMAT_TYPE_COLOR) {	if (surface->format->color.red_size > 0) {	    format.bpp = 32;	    	    if (surface->format->color.alpha_size > 0)		format.alpha_mask = 0xff000000;	    else		format.alpha_mask = 0x0;	    	    format.red_mask = 0xff0000;	    format.green_mask = 0xff00;	    format.blue_mask = 0xff;	} else {	    format.bpp = 8;	    format.blue_mask = format.green_mask = format.red_mask = 0x0;	    format.alpha_mask = 0xff;	}    } else {	format.bpp = 32;	format.alpha_mask = 0xff000000;	format.red_mask = 0xff0000;	format.green_mask = 0xff00;	format.blue_mask = 0xff;    }    pf.masks.bpp = format.bpp;    pf.masks.alpha_mask = format.alpha_mask;    pf.masks.red_mask = format.red_mask;    pf.masks.green_mask = format.green_mask;    pf.masks.blue_mask = format.blue_mask;    pf.xoffset = 0;    pf.skip_lines = 0;    pf.bytes_per_line = (((width * format.bpp) / 8) + 3) & -4;    pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;    pixels = malloc (height * pf.bytes_per_line);    if (!pixels)	return NULL;    buffer = glitz_buffer_create_for_data (pixels);    if (!buffer) {	free (pixels);	return NULL;    }        glitz_get_pixels (surface->surface,		      0, 0,		      width, height,		      &pf,		      buffer);    glitz_buffer_destroy (buffer);        image = (cairo_image_surface_t *)        _cairo_image_surface_create_with_masks (pixels,						&format,						width, height,						pf.bytes_per_line);        _cairo_image_surface_assume_ownership_of_data (image);    _cairo_image_surface_set_repeat (image, surface->base.repeat);    _cairo_image_surface_set_matrix (image, &(surface->base.matrix));    return image;}