[cairo-commit] 2 commits - src/win32
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jan 19 11:06:46 UTC 2021
src/win32/cairo-win32-surface.c | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit d49d8558199fb594a57bd84d386928aa8ebcfb7e
Merge: 941cddfa3 0134ac5a3
Author: Heiko Lewin <hlewin at gmx.de>
Date: Tue Jan 19 11:06:44 2021 +0000
Merge branch 'win32-get-dc' into 'master'
cairo_win32_surface_get_dc: Return NULL for error surfaces
Closes #405
See merge request cairo/cairo!106
commit 0134ac5a3d3599cf1f3da6ff286f67d3db43adfa
Author: Uli Schlachter <psychon at znc.in>
Date: Wed Jan 13 16:26:18 2021 +0100
cairo_win32_surface_get_dc: Return NULL for error surfaces
Surfaces from _cairo_surface_create_in_error() have no backend. This
commit fixes a NULL pointer dereference in cairo_win32_surface_get_dc().
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/405
Signed-off-by: Uli Schlachter <psychon at znc.in>
diff --git a/src/win32/cairo-win32-surface.c b/src/win32/cairo-win32-surface.c
index f7285b92e..73078362d 100644
--- a/src/win32/cairo-win32-surface.c
+++ b/src/win32/cairo-win32-surface.c
@@ -155,6 +155,9 @@ _cairo_win32_surface_get_extents (void *abstract_surface,
HDC
cairo_win32_surface_get_dc (cairo_surface_t *surface)
{
+ if (surface->backend == NULL)
+ return NULL;
+
if (surface->backend->type == CAIRO_SURFACE_TYPE_WIN32)
return to_win32_surface(surface)->dc;
More information about the cairo-commit
mailing list