From ad9976eb223d4e0ffe8a3d72187cdfd37d586c73 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sat, 31 Mar 2012 13:04:12 -0500 Subject: [PATCH] gdiplus: Forbid creating path gradients with fewer than 2 points. --- dlls/gdiplus/brush.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index aa02598e340..4bf492817b5 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));