Compare commits

...

1 Commits

Author SHA1 Message Date
Oleg Dubinskiy
8e81542afb [WIN32K:NTGDI] AlphaBlend & TransparentBlt: check whether the source DC is an INFO DC too
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/.
2024-05-14 13:24:31 +02:00

View File

@@ -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);