Commit 93a5ce24 authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

gdiplus: Check that GdipAddPathLine2 is passed at least one point.

parent efd5f670
......@@ -627,7 +627,7 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
TRACE("(%p, %p, %d)\n", path, points, count);
if(!path || !points)
if(!path || !points || count < 1)
return InvalidParameter;
if(!lengthen_path(path, count))
......
......@@ -308,6 +308,16 @@ static void test_line2(void)
}
GdipCreatePath(FillModeAlternate, &path);
status = GdipAddPathLine2(NULL, line2_points, 2);
expect(InvalidParameter, status);
status = GdipAddPathLine2(path, NULL, 2);
expect(InvalidParameter, status);
status = GdipAddPathLine2(path, line2_points, 0);
expect(InvalidParameter, status);
status = GdipAddPathLine2(path, line2_points, -1);
expect(InvalidParameter, status);
status = GdipAddPathLine2(path, line2_points, 3);
expect(Ok, status);
status = GdipAddPathLine2(path, &(line2_points[3]), 3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment