1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-16 12:03:03 -05:00

Fix segfault in general_textout with variable-pitch fonts: we can't

pass null lpDx, because general_textout depends on it being filled in.
Instead we null it out in the calls to subroutines _from_
general_textout.

[originally from svn r9064]
This commit is contained in:
Simon Tatham 2010-12-29 16:00:58 +00:00
parent 00b32eda3c
commit 3a691b5e0d

View File

@ -1323,7 +1323,8 @@ for(k=0;k<j-i;k++)debug((" U+%04X", lpString[i+k]));
debug(("\n rect: [%d,%d %d,%d]\n", newrc.left, newrc.top, newrc.right, newrc.bottom)); debug(("\n rect: [%d,%d %d,%d]\n", newrc.left, newrc.top, newrc.right, newrc.bottom));
} }
#endif #endif
exact_textout(hdc, xp, y, &newrc, lpString+i, j-i, lpDx+i, opaque); exact_textout(hdc, xp, y, &newrc, lpString+i, j-i,
font_varpitch ? NULL : lpDx+i, opaque);
} else { } else {
#ifdef FIXME_REMOVE_BEFORE_CHECKIN #ifdef FIXME_REMOVE_BEFORE_CHECKIN
{ {
@ -1338,7 +1339,8 @@ debug(("\n rect: [%d,%d %d,%d]\n", newrc.left, newrc.top, newrc.right,
newrc.top = lprc->top; newrc.top = lprc->top;
newrc.bottom = lprc->bottom; newrc.bottom = lprc->bottom;
ExtTextOutW(hdc, xp, y, ETO_CLIPPED | (opaque ? ETO_OPAQUE : 0), ExtTextOutW(hdc, xp, y, ETO_CLIPPED | (opaque ? ETO_OPAQUE : 0),
&newrc, lpString+i, j-i, lpDx+i); &newrc, lpString+i, j-i,
font_varpitch ? NULL : lpDx+i);
} }
i = j; i = j;
@ -3508,7 +3510,7 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
/* print Glyphs as they are, without Windows' Shaping*/ /* print Glyphs as they are, without Windows' Shaping*/
general_textout(hdc, x + xoffset, general_textout(hdc, x + xoffset,
y - font_height * (lattr==LATTR_BOT) + text_adjust, y - font_height * (lattr==LATTR_BOT) + text_adjust,
&line_box, wbuf, len, IpDxReal, &line_box, wbuf, len, IpDx,
opaque && !(attr & TATTR_COMBINING)); opaque && !(attr & TATTR_COMBINING));
/* And the shadow bold hack. */ /* And the shadow bold hack. */