diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-05 18:22:32 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-05 18:22:32 -0400 |
commit | 2df0c204d31f1f734491302b5640735030f325e5 (patch) | |
tree | 79994ec09347b3149585f40c7df40bb846a0bd6f /pango/pango-markup.c | |
parent | 2a4a6a4219992a32df04461a4a100be1969fd0e7 (diff) | |
download | pango-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.c | 13 |
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)); } |