summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cairo-pdf-surface.c12
-rw-r--r--util/cairo-script/cairo-script-scanner.c1
2 files changed, 9 insertions, 4 deletions
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 552e4bf4f..db5006294 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1101,18 +1101,22 @@ _cairo_pdf_surface_create_smask_group (cairo_pdf_surface_t *surface,
static void
_cairo_pdf_smask_group_destroy (cairo_pdf_smask_group_t *group)
{
+ if(group != NULL)
+ {
if (group->operation == PDF_FILL || group->operation == PDF_STROKE)
- _cairo_path_fixed_fini (&group->path);
+ _cairo_path_fixed_fini (&group->path);
if (group->source)
- cairo_pattern_destroy (group->source);
+ cairo_pattern_destroy (group->source);
if (group->mask)
- cairo_pattern_destroy (group->mask);
+ cairo_pattern_destroy (group->mask);
free (group->utf8);
free (group->glyphs);
free (group->clusters);
if (group->scaled_font)
- cairo_scaled_font_destroy (group->scaled_font);
+ cairo_scaled_font_destroy (group->scaled_font);
free (group);
+ group = NULL;
+ }
}
static cairo_int_status_t
diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c
index b9d445bb3..4b7598d2e 100644
--- a/util/cairo-script/cairo-script-scanner.c
+++ b/util/cairo-script/cairo-script-scanner.c
@@ -1328,6 +1328,7 @@ scan_base64:
goto scan_none;
}
longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ break;
default:
base64_add (ctx, scan, c);