Paul Vriens : gdiplus: Don't use struct member before NULL check
(Coverity) .
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jul 11 07:50:51 CDT 2007
Module: wine
Branch: master
Commit: a2406b8ca5c5d01bd70a8666ab6449a7a2730984
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a2406b8ca5c5d01bd70a8666ab6449a7a2730984
Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date: Tue Jul 10 19:39:57 2007 +0200
gdiplus: Don't use struct member before NULL check (Coverity).
---
dlls/gdiplus/graphicspath.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index 7c0e826..5df628d 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -66,7 +66,7 @@ static BOOL lengthen_path(GpPath *path, INT len)
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
INT count)
{
- INT i, old_count = path->pathdata.Count;
+ INT i, old_count;
if(!path || !points)
return InvalidParameter;
@@ -74,6 +74,8 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
if(!lengthen_path(path, count))
return OutOfMemory;
+ old_count = path->pathdata.Count;
+
for(i = 0; i < count; i++){
path->pathdata.Points[old_count + i].X = points[i].X;
path->pathdata.Points[old_count + i].Y = points[i].Y;
More information about the wine-cvs
mailing list