[cairo-commit] 2 commits - src/cairo-quartz-image-surface.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 11 19:12:12 UTC 2021


 src/cairo-quartz-image-surface.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 38a5c6036881fd2fb9654127b6847467941482a1
Merge: 3894a1ab3 38e486b34
Author: Heiko Lewin <hlewin at gmx.de>
Date:   Thu Feb 11 19:12:10 2021 +0000

    cairo-quartz-image-surface.c: Fix types

commit 38e486b34d435130f2fb38c429e6016c3c82cd53
Author: Heiko Lewin <hlewin at gmx.de>
Date:   Thu Feb 11 19:12:10 2021 +0000

    cairo-quartz-image-surface.c: Fix types

diff --git a/src/cairo-quartz-image-surface.c b/src/cairo-quartz-image-surface.c
index adc722923..30d92d6be 100644
--- a/src/cairo-quartz-image-surface.c
+++ b/src/cairo-quartz-image-surface.c
@@ -88,7 +88,7 @@ _cairo_quartz_image_surface_finish (void *asurface)
     cairo_quartz_image_surface_t *surface = (cairo_quartz_image_surface_t *) asurface;
 
     CGImageRelease (surface->image);
-    cairo_surface_destroy (surface->imageSurface);
+    cairo_surface_destroy ( (cairo_surface_t*) surface->imageSurface);
     return CAIRO_STATUS_SUCCESS;
 }
 
@@ -341,8 +341,10 @@ cairo_quartz_image_surface_create (cairo_surface_t *surface)
     memset (qisurf, 0, sizeof(cairo_quartz_image_surface_t));
 
     image_data = _cairo_malloc_ab (height, stride);
-    if (unlikely (!image_data))
-	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    if (unlikely (!image_data)) {
+	free(qisurf);
+	return SURFACE_ERROR_NO_MEMORY;
+    }
 
     memcpy (image_data, image_surface->data, height * stride);
     image = CairoQuartzCreateCGImage (format,
@@ -382,7 +384,7 @@ cairo_quartz_image_surface_get_image (cairo_surface_t *asurface)
 
     /* Throw an error for a non-quartz surface */
     if (! _cairo_surface_is_quartz (asurface)) {
-        return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
+        return SURFACE_ERROR_TYPE_MISMATCH;
     }
 
     return (cairo_surface_t*) surface->imageSurface;


More information about the cairo-commit mailing list