From 96acfcb3dc42d80bcbe5d25bdd387a7b75a9f1b3 Mon Sep 17 00:00:00 2001 From: Oleg Dubinskiy Date: Tue, 14 May 2024 19:08:37 +0200 Subject: [PATCH] [NTGDI] AlphaBlend/TransparentBlt: check whether the source DC is an INFO DC too (#6885) Improve checks in AlphaBlend and TransparentBlt functions: check whether DCSrc is of DCTYPE_INFO also, to fail in that case properly too. Spotted by PVS-Studio analysis. Reference: https://pvs-studio.com/en/blog/posts/cpp/1122/. --- win32ss/gdi/ntgdi/bitblt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32ss/gdi/ntgdi/bitblt.c b/win32ss/gdi/ntgdi/bitblt.c index ab45fe820197f..c60be249739a0 100644 --- a/win32ss/gdi/ntgdi/bitblt.c +++ b/win32ss/gdi/ntgdi/bitblt.c @@ -61,7 +61,7 @@ NtGdiAlphaBlend( DCDest = apObj[0]; DCSrc = apObj[1]; - if (DCDest->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO) + if (DCSrc->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO) { GDIOBJ_vUnlockObject(&DCSrc->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject); @@ -239,7 +239,7 @@ NtGdiTransparentBlt( DCDest = apObj[0]; DCSrc = apObj[1]; - if (DCDest->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO) + if (DCSrc->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO) { GDIOBJ_vUnlockObject(&DCSrc->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject);