mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 23:08:03 +02:00
image: Check for an error surface before dereferencing the backend
As the surface->backend will be NULL in such an error surface, and we may be legitimately doing boundary checks to reject the error surface. The alternative would be to set an explicit error surface backend. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54664 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
b0c466e27a
commit
558f0a5ab4
1 changed files with 2 additions and 1 deletions
|
|
@ -73,7 +73,8 @@ _cairo_image_surface_is_clone (cairo_image_surface_t *image)
|
|||
static inline cairo_bool_t
|
||||
_cairo_surface_is_image (const cairo_surface_t *surface)
|
||||
{
|
||||
return surface->backend->type == CAIRO_SURFACE_TYPE_IMAGE;
|
||||
/* _cairo_surface_nil sets a NULL backend so be safe */
|
||||
return surface->backend && surface->backend->type == CAIRO_SURFACE_TYPE_IMAGE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue