From 9c8efee9bf06ac731454d293e269d5c909c8175b Mon Sep 17 00:00:00 2001 From: Katherine McKinley Date: Mon, 15 Jun 2009 11:24:56 +0200 Subject: [PATCH] draw: fix NULL pointer passed to pango_parse_markup() Signed-off-by: Julien Danjou --- draw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/draw.c b/draw.c index bea8ece5c..686bcfeb6 100644 --- a/draw.c +++ b/draw.c @@ -79,6 +79,7 @@ draw_iso2utf8(const char *iso, size_t len, char **dest, ssize_t *dlen) { warn("text conversion failed: %s", strerror(errno)); p_delete(dest); + return false; } if(dlen) @@ -172,6 +173,9 @@ draw_text_context_init(draw_text_context_t *data, const char *str, ssize_t slen) { GError *error = NULL; + if(!str) + return false; + if(!pango_parse_markup(str, slen, 0, &data->attr_list, &data->text, NULL, &error)) { warn("cannot parse pango markup: %s", error ? error->message : "unknown error");