From d091e2355276a8632c5bc1c296189ad0aac2673b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 21 Nov 2021 09:30:54 +0100 Subject: Fix union of overlapping charset subset ranges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libfonts_decode_font_description.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libfonts_decode_font_description.c b/libfonts_decode_font_description.c index 329d338..83cf5c2 100644 --- a/libfonts_decode_font_description.c +++ b/libfonts_decode_font_description.c @@ -118,7 +118,8 @@ fix_charset_subset(char *out, const char *in) saved = ranges[0]; for (i = 1; i < n; i++) { if (ranges[i].first <= saved.last) { - saved.last = ranges[i].last; + if (ranges[i].last > saved.last) + saved.last = ranges[i].last; } else { if (saved.first == saved.last) out += sprintf(out, "%"PRId32" ", saved.first); -- cgit v1.2.3-70-g09d2