aboutsummaryrefslogtreecommitdiff
path: root/libXft/src/xftcore.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXft/src/xftcore.c')
-rw-r--r--libXft/src/xftcore.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libXft/src/xftcore.c b/libXft/src/xftcore.c
index 3f8710929..a0103cf26 100644
--- a/libXft/src/xftcore.c
+++ b/libXft/src/xftcore.c
@@ -1253,7 +1253,17 @@ XftGlyphFontSpecCore (XftDraw *draw,
if (i)
{
if (g_x1 < x1)
+ {
+ if (g_x1 < 0)
+ {
+ /* do nothing if the given glyphs are out of range */
+ short t = glyphs[i-1].font->max_advance_width
+ + glyphs[i-1].x;
+ if (t < 0 && glyphs[i-1].x > 0)
+ goto bail1;
+ }
x1 = g_x1;
+ }
if (g_y1 < y1)
y1 = g_y1;
if (g_x2 > x2)