Cherry-pick https://gitlab.freedesktop.org/cairo/cairo/-/commit/941cddfa39584e812d41b16fc80c67a2f9007658 draft
authorJonathan Kew <jkew@mozilla.com>
Fri, 05 Feb 2021 15:11:17 +0000
changeset 3667297 315dae85fa9ee3a70c60e61e2e179e2f69a8977e
parent 3667296 0e72cef97030c8adfca2387894600be7352feccb
child 3667298 1081f7a6419d2dbc2a088898c606738e21e3f12f
push id683063
push userjkew@mozilla.com
push dateMon, 19 Apr 2021 13:15:26 +0000
treeherdertry@919daaf50d14 [default view] [failures only]
milestone89.0a1
Cherry-pick https://gitlab.freedesktop.org/cairo/cairo/-/commit/941cddfa39584e812d41b16fc80c67a2f9007658 'Fix' a NULL pointer 'dereference' in cairo-pdf-surface
gfx/cairo/cairo/src/cairo-pdf-surface.c
--- a/gfx/cairo/cairo/src/cairo-pdf-surface.c
+++ b/gfx/cairo/cairo/src/cairo-pdf-surface.c
@@ -938,17 +938,18 @@ static void
     for (i = 0; i < size; i++) {
 	_cairo_array_copy_element (&surface->smask_groups, i, &group);
 	_cairo_pdf_smask_group_destroy (group);
     }
     _cairo_array_truncate (&surface->smask_groups, 0);
     _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;
 }
 
 static void
 _cairo_pdf_group_resources_init (cairo_pdf_group_resources_t *res)
 {
     int i;