From f93965bd56355b8fb01dbfdea8ec2001bfc9d2c2 Mon Sep 17 00:00:00 2001 From: Thomas Morley Date: Wed, 3 May 2017 00:58:02 +0200 Subject: [PATCH] Issue 5131 Avoid possible segfault in stencil-with-color Check whether the argument is of type color at all --- scm/stencil.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scm/stencil.scm b/scm/stencil.scm index 00f8503487..391e80882f 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -727,10 +727,12 @@ box, remains the same." replaced-stil)) (define-public (stencil-with-color stencil color) - (ly:make-stencil - (list 'color color (ly:stencil-expr stencil)) - (ly:stencil-extent stencil X) - (ly:stencil-extent stencil Y))) + (if (color? color) + (ly:make-stencil + (list 'color color (ly:stencil-expr stencil)) + (ly:stencil-extent stencil X) + (ly:stencil-extent stencil Y)) + stencil)) (define*-public (stencil-whiteout-outline stil #:optional (thickness 0.3) (color white) -- 2.39.2