https://git.reactos.org/?p=reactos.git;a=commitdiff;h=068687e0fde0f417ed8a8…
commit 068687e0fde0f417ed8a81c44a0009de721da68a
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Wed Mar 31 09:59:44 2021 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Wed Mar 31 16:39:57 2021 +0200
[WIN32K] Fix off-by-one errors
Spotted by Doug Lyons
CORE-17520
---
win32ss/gdi/dib/dib1bpp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/win32ss/gdi/dib/dib1bpp.c b/win32ss/gdi/dib/dib1bpp.c
index 6a90282808d..c1b33ad4182 100644
--- a/win32ss/gdi/dib/dib1bpp.c
+++ b/win32ss/gdi/dib/dib1bpp.c
@@ -78,7 +78,7 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
{
LONG yDst = DestRect->top + Height;
LONG ySrc = bTopToBottom ?
- SourcePoint->y + RECTL_lGetHeight(DestRect) - Height
+ SourcePoint->y + RECTL_lGetHeight(DestRect) - Height - 1
: SourcePoint->y + Height;
LONG Width = RECTL_lGetWidth(DestRect);
@@ -86,7 +86,7 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
{
LONG xDst = DestRect->left + Width;
LONG xSrc = bLeftToRight ?
- SourcePoint->x + RECTL_lGetWidth(DestRect) - Width
+ SourcePoint->x + RECTL_lGetWidth(DestRect) - Width - 1
: SourcePoint->x + Width;
ULONG PixelPut = DIB_1BPP_GetPixel(SourceSurf, xSrc, ySrc);
if (XorBit)