Alexandre Julliard : gdi32: Properly handle SetDIBits failure in StretchDIBits.

Alexandre Julliard julliard at winehq.org
Mon Mar 10 17:05:03 CDT 2008


Module: wine
Branch: master
Commit: 5953a86ab180575c71f3d001e0c6a05cf8348c26
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5953a86ab180575c71f3d001e0c6a05cf8348c26

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar 10 17:21:33 2008 +0100

gdi32: Properly handle SetDIBits failure in StretchDIBits.

---

 dlls/gdi32/dib.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
index f5e8707..3205d0d 100644
--- a/dlls/gdi32/dib.c
+++ b/dlls/gdi32/dib.c
@@ -290,13 +290,13 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
                             dwRop );
             }
 
-            SetDIBits(hdcMem, hBitmap, 0, height, bits, info, wUsage);
+            heightSrc = SetDIBits(hdcMem, hBitmap, 0, height, bits, info, wUsage);
 
             /* Origin for DIBitmap may be bottom left (positive biHeight) or top
                left (negative biHeight) */
-            StretchBlt( hdc, xDst, yDst, widthDst, heightDst,
-                hdcMem, xSrc, abs(height) - heightSrc - ySrc,
-                widthSrc, heightSrc, dwRop );
+            if (heightSrc) StretchBlt( hdc, xDst, yDst, widthDst, heightDst,
+                                       hdcMem, xSrc, abs(height) - heightSrc - ySrc,
+                                       widthSrc, heightSrc, dwRop );
             if(hpal)
                 SelectPalette(hdcMem, hpal, FALSE);
             SelectObject( hdcMem, hOldBitmap );




More information about the wine-cvs mailing list