From: Simon Tatham Date: Wed, 29 Dec 2010 16:00:58 +0000 (+0000) Subject: Fix segfault in general_textout with variable-pitch fonts: we can't X-Git-Tag: 0.61~41 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=3a691b5e0df3a4cf21dffe0de1c6106caf7ce88f;p=PuTTY.git 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] --- diff --git a/windows/window.c b/windows/window.c index f47fb478..9060bd10 100644 --- a/windows/window.c +++ b/windows/window.c @@ -1323,7 +1323,8 @@ for(k=0;ktop; newrc.bottom = lprc->bottom; 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; @@ -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*/ general_textout(hdc, x + xoffset, y - font_height * (lattr==LATTR_BOT) + text_adjust, - &line_box, wbuf, len, IpDxReal, + &line_box, wbuf, len, IpDx, opaque && !(attr & TATTR_COMBINING)); /* And the shadow bold hack. */