Author: spouliot
Date: 2006-01-13 15:01:55 -0500 (Fri, 13 Jan 2006)
New Revision: 55542

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/graphics-path.c
Log:
2006-01-13  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * graphics-path.c: Added checks for the number of points added when
        using AddBeziers (4 points for the first, 3 afterward) and the minimum
        of point required to add a Curve, ClosedCurve and a Polygon.



Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-01-13 19:48:15 UTC (rev 55541)
+++ trunk/libgdiplus/src/ChangeLog      2006-01-13 20:01:55 UTC (rev 55542)
@@ -1,3 +1,9 @@
+2006-01-13  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * graphics-path.c: Added checks for the number of points added when
+       using AddBeziers (4 points for the first, 3 afterward) and the minimum
+       of point required to add a Curve, ClosedCurve and a Polygon.
+
 2006-01-01 Jordi Mas i Hernandez  <[EMAIL PROTECTED]>
 
        * bitmap.c: Fixes 77131

Modified: trunk/libgdiplus/src/graphics-path.c
===================================================================
--- trunk/libgdiplus/src/graphics-path.c        2006-01-13 19:48:15 UTC (rev 
55541)
+++ trunk/libgdiplus/src/graphics-path.c        2006-01-13 20:01:55 UTC (rev 
55542)
@@ -2,6 +2,7 @@
  * graphics-path.c
  *
  * Copyright (C) 2003, Novell Inc.
+ * Copyright (C) 2006 Novell, Inc (http://www.novell.com)
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software 
  * and associated documentation files (the "Software"), to deal in the 
Software without restriction, 
@@ -668,6 +669,9 @@
        GpPointF *tmp = (GpPointF *) points;
        g_return_val_if_fail (path != NULL, InvalidParameter);
        g_return_val_if_fail (points != NULL, InvalidParameter);
+       /* first bezier requires 4 points, other 3 more points */
+       if ((count < 4) || ((count % 3) != 1))
+               return InvalidParameter;
         
         append_point (path, *tmp, PathPointTypeLine);
         tmp++;
@@ -697,6 +701,8 @@
         GpPointF *tangents;
        g_return_val_if_fail (path != NULL, InvalidParameter);
        g_return_val_if_fail (points != NULL, InvalidParameter);
+       if (count < 2)
+               return InvalidParameter;
 
         tangents = gdip_open_curve_tangents (CURVE_MIN_TERMS, points, count, 
tension);
 
@@ -718,6 +724,8 @@
 {
         GpPointF *tangents;
        g_return_val_if_fail (points != NULL, InvalidParameter);
+       if (count < 3)
+               return InvalidParameter;
 
         tangents = gdip_closed_curve_tangents (CURVE_MIN_TERMS, points, count, 
tension);
 
@@ -848,6 +856,8 @@
         GpPointF *tmp = (GpPointF *) points;
        g_return_val_if_fail (path != NULL, InvalidParameter);
        g_return_val_if_fail (points != NULL, InvalidParameter);
+       if (count < 3)
+               return InvalidParameter;
         
         append_point (path, *tmp, PathPointTypeStart);
         tmp ++;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to