summaryrefslogtreecommitdiff
path: root/pango/pango-markup.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-05 18:22:32 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-05 18:22:32 -0400
commit2df0c204d31f1f734491302b5640735030f325e5 (patch)
tree79994ec09347b3149585f40c7df40bb846a0bd6f /pango/pango-markup.c
parent2a4a6a4219992a32df04461a4a100be1969fd0e7 (diff)
downloadpango-2df0c204d31f1f734491302b5640735030f325e5.tar.gz
Avoid a critical from markup parsing
gravity='auto' is not a valid value here. Closes: https://gitlab.gnome.org/GNOME/pango/issues/203
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r--pango/pango-markup.c13
1 files changed, 13 insertions, 0 deletions
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 <span> 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));
}