Commit 7bfa21cb authored by John Elliot's avatar John Elliot Committed by Alexandre Julliard

Some fonts may have no characters at all for some reason, avoid crashes.

parent 625653f9
...@@ -968,7 +968,8 @@ static INT XFONT_GetAvgCharWidth( LPIFONTINFO16 pFI, const XFontStruct* x_fs, ...@@ -968,7 +968,8 @@ static INT XFONT_GetAvgCharWidth( LPIFONTINFO16 pFI, const XFontStruct* x_fs,
chars++; chars++;
} }
} }
avg = (width + (chars>>1))/ chars; if (chars) avg = (width + (chars>>1))/ chars;
else avg = 0; /* No characters exist at all */
} }
else /* uniform width */ else /* uniform width */
avg = x_fs->min_bounds.width; avg = x_fs->min_bounds.width;
......
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