зеркало из https://github.com/github/putty.git
Stop multifont fallback from crashing in GTK1.
I was tacitly assuming that mfont->fallback would always be non-NULL, which is true in a world containing Pango, but untrue in GTK1 when Pango isn't there. In that situation we fall back to just omitting the characters that would be displayed in the fallback font, on the grounds that that's better than dereferencing through a NULL vtable.
This commit is contained in:
Родитель
f3f215423b
Коммит
0f60287f66
|
@ -1631,6 +1631,7 @@ static void multifont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
|
|||
int wide, int bold, int cellwidth)
|
||||
{
|
||||
struct multifont *mfont = (struct multifont *)font;
|
||||
unifont *f;
|
||||
int ok, i;
|
||||
|
||||
while (len > 0) {
|
||||
|
@ -1647,8 +1648,10 @@ static void multifont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
|
|||
/*
|
||||
* Now display it.
|
||||
*/
|
||||
unifont_draw_text(target, gc, ok ? mfont->main : mfont->fallback,
|
||||
x, y, string, i, wide, bold, cellwidth);
|
||||
f = ok ? mfont->main : mfont->fallback;
|
||||
if (f)
|
||||
unifont_draw_text(target, gc, f, x, y, string, i, wide, bold,
|
||||
cellwidth);
|
||||
string += i;
|
||||
len -= i;
|
||||
x += i * cellwidth;
|
||||
|
|
Загрузка…
Ссылка в новой задаче