Author: spouliot
Date: 2006-08-09 17:20:28 -0400 (Wed, 09 Aug 2006)
New Revision: 63566

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/graphics-path.c
Log:
graphics-path.c: Changed null check not to print warnings during unit tests. 
Added more memory allocation failure checks.

Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-08-09 21:13:11 UTC (rev 63565)
+++ trunk/libgdiplus/src/ChangeLog      2006-08-09 21:20:28 UTC (rev 63566)
@@ -1,3 +1,8 @@
+2006-08-09  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * graphics-path.c: Changed null check not to print warnings during 
+       unit tests. Added more memory allocation failure checks.
+
 2006-08-08  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * region.c: Fix exclude on rectangular region to work with negative

Modified: trunk/libgdiplus/src/graphics-path.c
===================================================================
--- trunk/libgdiplus/src/graphics-path.c        2006-08-09 21:13:11 UTC (rev 
63565)
+++ trunk/libgdiplus/src/graphics-path.c        2006-08-09 21:20:28 UTC (rev 
63566)
@@ -253,6 +253,8 @@
        g_return_val_if_fail (points != NULL, InvalidParameter);
 
        pt = convert_points (points, count);
+       if (!pt)
+               return OutOfMemory;
        
        s = GdipCreatePath2 (pt, types, count, fillMode, path);
 
@@ -272,6 +274,9 @@
        g_return_val_if_fail (clonePath != NULL, InvalidParameter);
 
         *clonePath = (GpPath *) GdipAlloc (sizeof (GpPath));
+       if (!*clonePath)
+               return OutOfMemory;
+
         (*clonePath)->fill_mode = path->fill_mode;
         (*clonePath)->count = path->count;
         (*clonePath)->points = g_array_new (FALSE, FALSE, sizeof (GpPointF));
@@ -291,7 +296,8 @@
 GpStatus
 GdipDeletePath (GpPath *path)
 {
-       g_return_val_if_fail (path != NULL, InvalidParameter);
+       if (path == NULL)
+               return InvalidParameter;
 
        if (path->points != NULL)
                g_array_free (path->points, TRUE);
@@ -308,7 +314,8 @@
 GpStatus
 GdipResetPath (GpPath *path)
 {
-       g_return_val_if_fail (path != NULL, InvalidParameter);
+       if (path == NULL)
+               return InvalidParameter;
 
        if (path->points != NULL)
                g_array_free (path->points, TRUE);

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

Reply via email to