From: Piotr Caban <piotr(a)codeweavers.com> --- 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)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2680