gdi32: Check for NULL pointer in GetOutlineTextMetrics.
This commit is contained in:
parent
5c000dca57
commit
22c51eeabf
|
@ -7722,7 +7722,7 @@ static UINT freetype_GetOutlineTextMetrics( PHYSDEV dev, UINT cbSize, OUTLINETEX
|
|||
|
||||
if (physdev->font->potm || get_outline_text_metrics( physdev->font ))
|
||||
{
|
||||
if(cbSize >= physdev->font->potm->otmSize)
|
||||
if(potm && cbSize >= physdev->font->potm->otmSize)
|
||||
{
|
||||
memcpy(potm, physdev->font->potm, physdev->font->potm->otmSize);
|
||||
scale_outline_font_metrics(physdev->font, potm);
|
||||
|
|
|
@ -2147,6 +2147,11 @@ static void test_GetOutlineTextMetrics(void)
|
|||
}
|
||||
ok(otm->otmpFullName == unset_ptr, "expected %p got %p\n", unset_ptr, otm->otmpFullName);
|
||||
|
||||
/* check handling of NULL pointer */
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = GetOutlineTextMetricsA(hdc, otm_size, NULL);
|
||||
ok(ret == otm_size, "expected %u, got %u, error %d\n", otm_size, ret, GetLastError());
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, otm);
|
||||
|
||||
SelectObject(hdc, hfont_old);
|
||||
|
|
Loading…
Reference in New Issue