[1/4] gdiplus: Return OutOfMemory when creating a path gradient with NULL points.

Vincent Povirk madewokherd at gmail.com
Thu Apr 26 08:51:41 CDT 2012


-------------- next part --------------
From d1bcc8dc8b57598a7bc334a83a3ea79d1b31c707 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Tue, 24 Apr 2012 10:22:58 -0500
Subject: [PATCH 1/8] gdiplus: Return OutOfMemory when creating a path
 gradient with NULL points.

This fixes a Mono test case.
---
 dlls/gdiplus/brush.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index c11dea6..8dfa18d 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -578,10 +578,10 @@ GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
 
     TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
 
-    if(!points || !grad)
+    if(!grad)
         return InvalidParameter;
 
-    if(count <= 0)
+    if(!points || count <= 0)
         return OutOfMemory;
 
     stat = GdipCreatePath(FillModeAlternate, &path);
@@ -611,10 +611,10 @@ GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint* points,
 
     TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
 
-    if(!points || !grad)
+    if(!grad)
         return InvalidParameter;
 
-    if(count <= 0)
+    if(!points || count <= 0)
         return OutOfMemory;
 
     stat = GdipCreatePath(FillModeAlternate, &path);
-- 
1.7.9.5


More information about the wine-patches mailing list