Skip to content

Commit

Permalink
[NTGDI] AlphaBlend/TransparentBlt: check whether the source DC is an …
Browse files Browse the repository at this point in the history
…INFO DC too (reactos#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/.
  • Loading branch information
oleg-dubinskiy authored May 14, 2024
1 parent 2b0d1fa commit 96acfcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions win32ss/gdi/ntgdi/bitblt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 96acfcb

Please sign in to comment.