From 85afe48c3e44c294d08c4a8b838099f8f2fb1c97 Mon Sep 17 00:00:00 2001 From: Doug Lyons Date: Thu, 24 Apr 2025 21:04:36 -0500 Subject: [PATCH] [GDI32] Fix MSVC warning in SetDIBitsToDevice and simplify code. (#7919) This is a very small revert of PR #5227 to simplify the code and eliminate an MSVC warning. It was pointed out by Timo Kreuzer as probably not doing what I intended and he was correct. I added this code in PR #5227 to try and correct some return values from SetDIBitsToDevice. After testing with this new PR, there was no difference in the regression tests for either 1) gdi32:bitmap or 2) gdi32:SetDIBitsToDevice after deleting the code here and the MSVC warning was fixed. --- win32ss/gdi/gdi32/objects/bitmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win32ss/gdi/gdi32/objects/bitmap.c b/win32ss/gdi/gdi32/objects/bitmap.c index 343b2b55bd0..108d69dca80 100644 --- a/win32ss/gdi/gdi32/objects/bitmap.c +++ b/win32ss/gdi/gdi32/objects/bitmap.c @@ -1019,8 +1019,7 @@ SetDIBitsToDevice( if (pConvertedInfo->bmiHeader.biHeight < 0) { - if (pConvertedInfo->bmiHeader.biHeight < -MaxSourceHeight || - (YDest >= 0 && src_y < -ScanLines)) + if (pConvertedInfo->bmiHeader.biHeight < -MaxSourceHeight || YDest >= 0) { LinesCopied = ScanLines + src_y; }