https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a16fc5e19b5356d98a3bace9be3cf161304024a

commit 2a16fc5e19b5356d98a3bace9be3cf161304024a
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Tue Sep 12 05:56:36 2023 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Tue Sep 12 05:56:36 2023 +0900

    [NTGDI] GetPixel's return top byte is zero if valid (#5677)
    
    According to the results of CImage testcase,
    the top byte of the GetPixel() return value is
    zero if the return is a valid color.
    Do bitwise-AND operation if the color value is valid.
    CORE-19008
---
 win32ss/gdi/ntgdi/bitblt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/win32ss/gdi/ntgdi/bitblt.c b/win32ss/gdi/ntgdi/bitblt.c
index 2e3eaeef0b2..c86bbbc53ba 100644
--- a/win32ss/gdi/ntgdi/bitblt.c
+++ b/win32ss/gdi/ntgdi/bitblt.c
@@ -1598,6 +1598,9 @@ NtGdiGetPixel(
 
         /* Delete the surface */
         GDIOBJ_vDeleteObject(&psurfDest->BaseObject);
+
+        /* The top byte is zero */
+        ulRGBColor &= 0x00FFFFFF;
     }
 
 leave:

Reply via email to