mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[WIN32SS:GDI] Fix an off-by-one error in the StretchBlt mask bounds check (#9136)
The mask bounds check in `DIB_XXBPP_StretchBlt` allowed `sx == cx` (and similar for `sy`), reading one pixel past the end of the mask bitmap. On the contrary, the source-surface check a few lines below already does it right.
This commit is contained in:
@@ -174,7 +174,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma
|
||||
sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
|
||||
}
|
||||
if (sx < 0 || sy < 0 ||
|
||||
MaskSurf->sizlBitmap.cx < sx || MaskCy < sy ||
|
||||
MaskSurf->sizlBitmap.cx <= sx || MaskCy <= sy ||
|
||||
fnMask_GetPixel(MaskSurf, sx, sy) != 0)
|
||||
{
|
||||
CanDraw = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user