gdiplus: Check count argument in GdipTransformMatrixPoints.

This commit is contained in:
Nikolay Sivov 2008-05-13 02:04:51 +04:00 committed by Alexandre Julliard
parent 4e8ef34676
commit 5eaf84d39b
1 changed files with 4 additions and 1 deletions

View File

@ -244,7 +244,7 @@ GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
REAL x, y; REAL x, y;
INT i; INT i;
if(!matrix || !pts) if(!matrix || !pts || count <= 0)
return InvalidParameter; return InvalidParameter;
for(i = 0; i < count; i++) for(i = 0; i < count; i++)
@ -265,6 +265,9 @@ GpStatus WINGDIPAPI GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, I
GpStatus ret; GpStatus ret;
INT i; INT i;
if(count <= 0)
return InvalidParameter;
ptsF = GdipAlloc(sizeof(GpPointF) * count); ptsF = GdipAlloc(sizeof(GpPointF) * count);
if(!ptsF) if(!ptsF)
return OutOfMemory; return OutOfMemory;