Commit 22c51eea authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

gdi32: Check for NULL pointer in GetOutlineTextMetrics.

parent 5c000dca
......@@ -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);
......
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