dwrite: Handle allocation error (Coverity).
This commit is contained in:
parent
13d99144bd
commit
0e179e08b6
@ -930,6 +930,13 @@ HRESULT create_font_from_logfont(const LOGFONTW *logfont, IDWriteFont **font)
|
|||||||
|
|
||||||
ret = GetOutlineTextMetricsW(hdc, 0, NULL);
|
ret = GetOutlineTextMetricsW(hdc, 0, NULL);
|
||||||
otm = heap_alloc(ret);
|
otm = heap_alloc(ret);
|
||||||
|
if (!otm)
|
||||||
|
{
|
||||||
|
heap_free(This);
|
||||||
|
DeleteDC(hdc);
|
||||||
|
DeleteObject(hfont);
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
otm->otmSize = ret;
|
otm->otmSize = ret;
|
||||||
ret = GetOutlineTextMetricsW(hdc, otm->otmSize, otm);
|
ret = GetOutlineTextMetricsW(hdc, otm->otmSize, otm);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user