dwrite: Handle allocation error (Coverity).

This commit is contained in:
Nikolay Sivov 2012-11-29 07:38:21 -05:00 committed by Alexandre Julliard
parent 13d99144bd
commit 0e179e08b6
1 changed files with 7 additions and 0 deletions

View File

@ -930,6 +930,13 @@ HRESULT create_font_from_logfont(const LOGFONTW *logfont, IDWriteFont **font)
ret = GetOutlineTextMetricsW(hdc, 0, NULL);
otm = heap_alloc(ret);
if (!otm)
{
heap_free(This);
DeleteDC(hdc);
DeleteObject(hfont);
return E_OUTOFMEMORY;
}
otm->otmSize = ret;
ret = GetOutlineTextMetricsW(hdc, otm->otmSize, otm);