summaryrefslogtreecommitdiff
path: root/src/xftcore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xftcore.c')
-rw-r--r--src/xftcore.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xftcore.c b/src/xftcore.c
index 3f87109..a0103cf 100644
--- a/src/xftcore.c
+++ b/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)