From 2df0c204d31f1f734491302b5640735030f325e5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 5 Jul 2019 18:22:32 -0400 Subject: Avoid a critical from markup parsing gravity='auto' is not a valid value here. Closes: https://gitlab.gnome.org/GNOME/pango/issues/203 --- pango/pango-markup.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pango/pango-markup.c b/pango/pango-markup.c index 22bf4fef..7420fa85 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -1455,6 +1455,19 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, if (!span_parse_enum ("gravity", gravity, PANGO_TYPE_GRAVITY, (int*)(void*)&gr, line_number, error)) goto error; + if (gr == PANGO_GRAVITY_AUTO) + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'stretch' " + "attribute on tag, line %d; valid " + "values are for example 'south', 'east', " + "'north', 'west'"), + gravity, line_number); + goto error; + } + add_attribute (tag, pango_attr_gravity_new (gr)); } -- cgit v1.2.1