Nikolay Sivov : dwrite: Handle allocation error (Coverity).
Alexandre Julliard
julliard at winehq.org
Thu Nov 29 14:15:44 CST 2012
Module: wine
Branch: master
Commit: 0e179e08b67f3d7b69e1a258fd0e8318f8f6f3ce
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0e179e08b67f3d7b69e1a258fd0e8318f8f6f3ce
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu Nov 29 07:38:21 2012 -0500
dwrite: Handle allocation error (Coverity).
---
dlls/dwrite/font.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 7d332b7..0ec581b 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -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);
More information about the wine-cvs
mailing list