From: Vincent Povirk Subject: gdiplus: Fix error when drawing from a rectangle outside bitmap bounds. Message-Id: Date: Wed, 29 Oct 2014 12:38:48 -0500 For bug 37394. Supersedes 107306. From 589fd9d161b21d58f50acc45b454f8a2d544d9f2 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Tue, 28 Oct 2014 16:09:57 -0500 Subject: [PATCH 1/2] 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 { -- 2.1.0