summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-01-23 19:48:52 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-01-23 19:48:52 -0500
commitb5031e6e57c9462097db5c58f3a2f6293e9625ff (patch)
tree77dff5d8f6d431abb4240af4c50b6ac32a1397aa
parentf7f15d079ec5e4716d88ff5796dcfa9a2e1629e8 (diff)
downloadpango-b5031e6e57c9462097db5c58f3a2f6293e9625ff.tar.gz
Add some preconditions
The arguments to pango_attr_list_update are ints, but negative numbers don't make sense here.
-rw-r--r--pango/pango-attributes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 4f96135b..38a41517 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1697,6 +1697,10 @@ pango_attr_list_update (PangoAttrList *list,
{
guint i, p;
+ g_return_if_fail (pos >= 0);
+ g_return_if_fail (remove >= 0);
+ g_return_if_fail (add >= 0);
+
if (list->attributes)
for (i = 0, p = list->attributes->len; i < p; i++)
{