mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 17:30:19 +01:00
'Fix' a NULL pointer 'dereference' in cairo-pdf-surface
The expression &image_surface->base basically just casts the cairo_image_surface_t* to cairo_surface_t*. However, technically it is a NULL pointer dereference and UndefinedBehaviorSanitizer flags it as such: runtime error: member access within null pointer of type 'cairo_image_surface_t' (aka 'struct _cairo_image_surface') This commit fixes this by adding a NULL check. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
d72ff7c18a
commit
4e2e876be1
1 changed files with 2 additions and 1 deletions
|
|
@ -943,7 +943,8 @@ _cairo_pdf_surface_clear (cairo_pdf_surface_t *surface)
|
|||
_cairo_array_truncate (&surface->knockout_group, 0);
|
||||
_cairo_array_truncate (&surface->page_annots, 0);
|
||||
|
||||
cairo_surface_destroy (&surface->thumbnail_image->base);
|
||||
if (surface->thumbnail_image)
|
||||
cairo_surface_destroy (&surface->thumbnail_image->base);
|
||||
surface->thumbnail_image = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue