forked from mia/Aegisub
Fix buffer overflow when getting text extents
lfFaceName needs to be null-terminated, so only copy up to 31 characters into the buffer.
This commit is contained in:
parent
8a5b4ae3a3
commit
e60197962a
1 changed files with 1 additions and 1 deletions
|
@ -86,7 +86,7 @@ namespace Automation4 {
|
|||
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
||||
lf.lfQuality = ANTIALIASED_QUALITY;
|
||||
lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;
|
||||
wcsncpy(lf.lfFaceName, agi::charset::ConvertW(style->font).c_str(), 32);
|
||||
wcsncpy(lf.lfFaceName, agi::charset::ConvertW(style->font).c_str(), 31);
|
||||
|
||||
HFONT thefont = CreateFontIndirect(&lf);
|
||||
if (!thefont) return false;
|
||||
|
|
Loading…
Reference in a new issue