summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-05-23 16:47:30 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-05-23 16:47:30 +0000
commit3276a33b1ef9db42d46bf649d693016c4587f368 (patch)
tree4ff0402df2dcf9f3a982101d3971304bc46deb68 /pango
parent27b4ae6596c3d4ef6d11baff78300c18331f6349 (diff)
parentdad38adf4e8a7ca6fbbe09d8eba0c25aa0a393d4 (diff)
downloadpango-3276a33b1ef9db42d46bf649d693016c4587f368.tar.gz
Merge branch 'fix-attr-list-update' into 'master'
Avoid unsigned int pitfalls Closes #561 See merge request GNOME/pango!336
Diffstat (limited to 'pango')
-rw-r--r--pango/pango-attributes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 63c031f9..f97892a6 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1777,7 +1777,8 @@ pango_attr_list_update (PangoAttrList *list,
}
else if (attr->end_index >= pos + remove)
{
- if (G_MAXUINT - attr->end_index < add - remove)
+ if (add > remove &&
+ G_MAXUINT - attr->end_index < add - remove)
attr->end_index = G_MAXUINT;
else
attr->end_index += add - remove;