gdi: If there is no space for strings GetOutlineTextMetricsA should not indicate that they present.

This commit is contained in:
Dmitry Timoshkov 2006-09-18 19:00:44 +09:00 committed by Alexandre Julliard
parent 84b2d73d38
commit e41c0acc0c
1 changed files with 14 additions and 0 deletions

View File

@ -1483,6 +1483,20 @@ UINT WINAPI GetOutlineTextMetricsA(
if(output != lpOTM) {
memcpy(lpOTM, output, cbData);
HeapFree(GetProcessHeap(), 0, output);
/* check if the string offsets really fit into the provided size */
/* FIXME: should we check string length as well? */
if ((UINT_PTR)lpOTM->otmpFamilyName >= lpOTM->otmSize)
lpOTM->otmpFamilyName = 0; /* doesn't fit */
if ((UINT_PTR)lpOTM->otmpFaceName >= lpOTM->otmSize)
lpOTM->otmpFaceName = 0; /* doesn't fit */
if ((UINT_PTR)lpOTM->otmpStyleName >= lpOTM->otmSize)
lpOTM->otmpStyleName = 0; /* doesn't fit */
if ((UINT_PTR)lpOTM->otmpFullName >= lpOTM->otmSize)
lpOTM->otmpFullName = 0; /* doesn't fit */
}
end: