dwrite: Properly null-terminate name string when converting to WCHAR.

This commit is contained in:
Nikolay Sivov 2014-10-29 22:39:55 +03:00 committed by Alexandre Julliard
parent 4361cbabd7
commit 2bc984a5b1
1 changed files with 2 additions and 1 deletions

View File

@ -793,8 +793,9 @@ HRESULT opentype_get_font_strings_from_id(const void *table_data, DWRITE_INFORMA
if (codepage) {
DWORD len = MultiByteToWideChar(codepage, 0, (LPSTR)(storage_area + offset), length, NULL, 0);
name_string = heap_alloc(sizeof(WCHAR) * len);
name_string = heap_alloc(sizeof(WCHAR) * (len+1));
MultiByteToWideChar(codepage, 0, (LPSTR)(storage_area + offset), length, name_string, len);
name_string[len] = 0;
}
else {
int i;