From 261563f28e040512d95bb73b0673685809196924 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 13 Jan 2016 22:41:13 +0300 Subject: [PATCH] dwrite: Handle bitmap allocation error when rendering to bitmap target. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/gdiinterop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index ded37312441..794ebeeacb1 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -422,6 +422,11 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac if (texturetype == DWRITE_TEXTURE_CLEARTYPE_3x1) size *= 3; bitmap = heap_alloc_zero(size); + if (!bitmap) { + IDWriteGlyphRunAnalysis_Release(analysis); + return E_OUTOFMEMORY; + } + hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, texturetype, &target, bitmap, size); if (hr == S_OK) { /* blit to target dib */