mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-13 10:39:20 +02:00
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@znc.in>
This commit is contained in:
parent
974791b4ee
commit
0134ac5a3d
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue