diff options
author | Ravi Nanjundappa <nravi.n@samsung.com> | 2014-09-25 08:38:50 +0530 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2014-09-29 15:59:26 -0700 |
commit | 573ddfc3d5c08c37b95a21e0a1b34acecc646053 (patch) | |
tree | 2f7e451feaac31b23ca317a6aaa8e161934f7edf /src/cairo-quartz-image-surface.c | |
parent | 06b9f8fa2d179850cda8a0a103896bc011ce46d6 (diff) | |
download | cairo-573ddfc3d5c08c37b95a21e0a1b34acecc646053.tar.gz |
src: check the surface backend for NULL
This is a follow-up patch on top of 150c1e7044c57443d458e12bfc427d3a019cb60b
As discussed in the mailing list, http://lists.cairographics.org/archives/cairo/2014-September/025647.html,
check if the surfaces are of particular backend type or not, before proceeding further.
These changes are based on _cairo_surface_is_xlib() and _cairo_surface_is_image()
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Diffstat (limited to 'src/cairo-quartz-image-surface.c')
-rw-r--r-- | src/cairo-quartz-image-surface.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cairo-quartz-image-surface.c b/src/cairo-quartz-image-surface.c index 511b6346d..b4bc8b9fd 100644 --- a/src/cairo-quartz-image-surface.c +++ b/src/cairo-quartz-image-surface.c @@ -378,8 +378,10 @@ cairo_quartz_image_surface_get_image (cairo_surface_t *asurface) { cairo_quartz_image_surface_t *surface = (cairo_quartz_image_surface_t*) asurface; - if (asurface->type != CAIRO_SURFACE_TYPE_QUARTZ_IMAGE) + /* Throw an error for a non-quartz surface */ + if (! _cairo_surface_is_quartz (surface)) { return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH)); + } return (cairo_surface_t*) surface->imageSurface; } |