From: Thomas Morley Date: Tue, 2 May 2017 22:58:02 +0000 (+0200) Subject: Issue 5131 Avoid possible segfault in stencil-with-color X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=f93965bd56355b8fb01dbfdea8ec2001bfc9d2c2;p=lilypond.git Issue 5131 Avoid possible segfault in stencil-with-color Check whether the argument is of type color at all --- 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)