Haoyang Chen : gdi32: Avoid exceeding the actual bitmap height.

Alexandre Julliard julliard at winehq.org
Thu Nov 12 15:17:45 CST 2020


Module: wine
Branch: master
Commit: abd0cddc5fbf45736b5846affb12e299f5f3e99f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=abd0cddc5fbf45736b5846affb12e299f5f3e99f

Author: Haoyang Chen <chenhaoyang at uniontech.com>
Date:   Thu Nov 12 10:38:15 2020 +0000

gdi32: Avoid exceeding the actual bitmap height.

The bottom-up case is handled earlier on.  For the top-down
case, 'lines' is left untouched.

Signed-off-by: Haoyang Chen <chenhaoyang at uniontech.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/dib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
index 10a7a957973..790ecf06501 100644
--- a/dlls/gdi32/dib.c
+++ b/dlls/gdi32/dib.c
@@ -824,7 +824,7 @@ INT CDECL nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx
             }
             else if (src.y >= lines) return lines;
         }
-        src_info->bmiHeader.biHeight = top_down ? -lines : lines;
+        src_info->bmiHeader.biHeight = top_down ? -min( lines, height ) : lines;
         src_info->bmiHeader.biSizeImage = get_dib_image_size( src_info );
     }
 




More information about the wine-cvs mailing list