Module: wine Branch: master Commit: 08386cd984a6ebd116aa97c32bd8fcf14ed9de3e URL: https://gitlab.winehq.org/wine/wine/-/commit/08386cd984a6ebd116aa97c32bd8fcf...
Author: Piotr Caban piotr@codeweavers.com Date: Thu Apr 20 14:44:12 2023 +0200
wineps: Clip visible rectangle to bitmap size in get_vis_rectangles.
---
dlls/wineps.drv/printproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index b40f7a7962c..0a1f36c82d8 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -378,6 +378,10 @@ static void get_vis_rectangles(HDC hdc, struct bitblt_coords *dst, src->width = rect.right - rect.left; src->height = rect.bottom - rect.top; get_bounding_rect(&rect, src->x, src->y, src->width, src->height); + if (rect.left < 0) rect.left = 0; + if (rect.top < 0) rect.top = 0; + if (rect.right > width) rect.right = width; + if (rect.bottom > height) rect.bottom = height; src->visrect = rect;
intersect_vis_rectangles(dst, src); @@ -413,7 +417,7 @@ static int stretch_blt(PHYSDEV dev, const EMRSTRETCHBLT *blt, src.layout = 0;
get_vis_rectangles(dev->hdc, &dst, &blt->xformSrc, - bi->bmiHeader.biWidth, bi->bmiHeader.biHeight, &src); + bi->bmiHeader.biWidth, abs(bi->bmiHeader.biHeight), &src);
memcpy(dst_info, bi, blt->cbBmiSrc); memset(&bits, 0, sizeof(bits));