Vincent Povirk : gdiplus: Fix error when drawing from a rectangle outside bitmap bounds.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Oct 30 09:23:14 CDT 2014


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Tue Oct 28 16:09:57 2014 -0500

gdiplus: Fix error when drawing from a rectangle outside bitmap bounds.

---

 dlls/gdiplus/graphics.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index d192bf2..840d866 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -827,6 +827,10 @@ static void get_bitmap_sample_size(InterpolationMode interpolation, WrapMode wra
             right = bitmap->width-1;
         if (bottom >= bitmap->height)
             bottom = bitmap->height-1;
+        if (bottom < top || right < left)
+            /* entirely outside image, just sample a pixel so we don't have to
+             * special-case this later */
+            left = top = right = bottom = 0;
     }
     else
     {




More information about the wine-cvs mailing list