Commit d274ffc9 authored by Derek Wang's avatar Derek Wang Committed by Alan Coopersmith

XftGlyphFontSpecCore: check to make sure glyphs are in range

This fixes a crash reported when selecting "View Page Source" in Mozilla
on Solaris 10, due to invalid parameters being given to XPutImage.

http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6261221Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 652d9b47
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment