summaryrefslogtreecommitdiff
path: root/source/fitz/trace-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz/trace-device.c')
-rw-r--r--source/fitz/trace-device.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/fitz/trace-device.c b/source/fitz/trace-device.c
index 2965f958..0b77c075 100644
--- a/source/fitz/trace-device.c
+++ b/source/fitz/trace-device.c
@@ -17,10 +17,13 @@ static void
fz_trace_color(fz_context *ctx, fz_output *out, fz_colorspace *colorspace, const float *color, float alpha)
{
int i;
- fz_printf(ctx, out, " colorspace=\"%s\" color=\"", colorspace->name);
- for (i = 0; i < colorspace->n; i++)
- fz_printf(ctx, out, "%s%g", i == 0 ? "" : " ", color[i]);
- fz_printf(ctx, out, "\"");
+ if (colorspace)
+ {
+ fz_printf(ctx, out, " colorspace=\"%s\" color=\"", colorspace->name);
+ for (i = 0; i < colorspace->n; i++)
+ fz_printf(ctx, out, "%s%g", i == 0 ? "" : " ", color[i]);
+ fz_printf(ctx, out, "\"");
+ }
if (alpha < 1)
fz_printf(ctx, out, " alpha=\"%g\"", alpha);
}