[5/5] gdiplus: Forbid creating path gradients with fewer than 2 points.

Vincent Povirk madewokherd at gmail.com
Sat Mar 31 13:43:04 CDT 2012


-------------- next part --------------
From 223804dcc4ec4f806adb050e93aee66327bd039c Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Sat, 31 Mar 2012 13:04:12 -0500
Subject: [PATCH 5/8] gdiplus: Forbid creating path gradients with fewer than 2 points.

This fixes some of Mono's test cases.
---
 dlls/gdiplus/brush.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index aa02598..4bf4928 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -517,6 +517,9 @@ static GpStatus create_path_gradient(GpPath *path, GpPathGradient **grad)
     if(!path || !grad)
         return InvalidParameter;
 
+    if (path->pathdata.Count < 2)
+        return OutOfMemory;
+
     GdipGetPathWorldBounds(path, &bounds, NULL, NULL);
 
     *grad = GdipAlloc(sizeof(GpPathGradient));
-- 
1.7.2.5


More information about the wine-patches mailing list