aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wrap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wrap.c b/src/wrap.c
index 80a5b00..ae64f43 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -515,6 +515,15 @@ static void set_colour(struct sc_font_stack *stack, const char *colour)
GdkRGBA col;
struct sc_font *scf = &stack->stack[stack->n_fonts-1];
+ if ( colour == NULL ) {
+ printf("Invalid colour\n");
+ scf->col[0] = 0.0;
+ scf->col[1] = 0.0;
+ scf->col[2] = 0.0;
+ scf->col[3] = 1.0;
+ return;
+ }
+
gdk_rgba_parse(&col, colour);
scf->col[0] = col.red;