https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9fc56bfc9d34f1c69b18b…
commit 9fc56bfc9d34f1c69b18b28e433e494574a86641
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Aug 8 09:40:40 2022 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Dec 1 20:17:40 2022 +0200
[WIN32K] Fix missing NULL check in IntCreateDIBitmap
---
win32ss/gdi/ntgdi/dibobj.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/win32ss/gdi/ntgdi/dibobj.c b/win32ss/gdi/ntgdi/dibobj.c
index b7bf542446a..ec5fa69a469 100644
--- a/win32ss/gdi/ntgdi/dibobj.c
+++ b/win32ss/gdi/ntgdi/dibobj.c
@@ -1578,7 +1578,13 @@ IntCreateDIBitmap(
Surface = SURFACE_ShareLockSurface(handle);
ASSERT(Surface);
Palette = CreateDIBPalette(data, Dc, coloruse);
- ASSERT(Palette);
+ if (Palette == NULL)
+ {
+ SURFACE_ShareUnlockSurface(Surface);
+ GreDeleteObject(handle);
+ return NULL;
+ }
+
SURFACE_vSetPalette(Surface, Palette);
PALETTE_ShareUnlockPalette(Palette);