From ea8e3db7814764832b7c029cc65fa1fdf3ec2ad2 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 14 Aug 2009 22:08:15 +0000 Subject: [PATCH] [win32k] EngCreateDeviceBitmap: handle failure of EngLockSurface. Found by Amine. svn path=/trunk/; revision=42671 --- reactos/subsystems/win32/win32k/eng/surface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reactos/subsystems/win32/win32k/eng/surface.c b/reactos/subsystems/win32/win32k/eng/surface.c index 8ee3b0d6b25..c5140476ccc 100644 --- a/reactos/subsystems/win32/win32k/eng/surface.c +++ b/reactos/subsystems/win32/win32k/eng/surface.c @@ -191,6 +191,13 @@ EngCreateDeviceBitmap(IN DHSURF dhsurf, } pso = EngLockSurface((HSURF)NewBitmap); + if (!pso) + { + DPRINT1("EngLockSurface failed on newly created bitmap!\n"); + GreDeleteObject(NewBitmap); + return NULL; + } + pso->dhsurf = dhsurf; EngUnlockSurface(pso);