gdiplus: Forbid creating path gradients with fewer than 2 points.

This commit is contained in:
Vincent Povirk 2012-03-31 13:04:12 -05:00 committed by Alexandre Julliard
parent 52bf030b84
commit ad9976eb22
1 changed files with 3 additions and 0 deletions

View File

@ -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));