Author: spouliot
Date: 2006-03-19 11:43:38 -0500 (Sun, 19 Mar 2006)
New Revision: 58160

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/image.c
   trunk/libgdiplus/src/lineargradientbrush.c
Log:
2006-03-19  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * lineargradientbrush.c: The GpRect structure was never freed in 
        GdipCreateLineBrushFromRectWithAngleI. Now allocated on the stack.
        Temporary matrixes weren't freed in gdip_linear_gradient_setup and
        create_tile_linear functions.
        * image.c: Reordered code to avoid using memory we just freed in 
        gdip_get_imageformat_from_codec_clsid.



Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-03-19 16:37:21 UTC (rev 58159)
+++ trunk/libgdiplus/src/ChangeLog      2006-03-19 16:43:38 UTC (rev 58160)
@@ -1,3 +1,12 @@
+2006-03-19  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * lineargradientbrush.c: The GpRect structure was never freed in 
+       GdipCreateLineBrushFromRectWithAngleI. Now allocated on the stack.
+       Temporary matrixes weren't freed in gdip_linear_gradient_setup and
+       create_tile_linear functions.
+       * image.c: Reordered code to avoid using memory we just freed in 
+       gdip_get_imageformat_from_codec_clsid.
+
 2006-03-18  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * image.c: Free the image palette on dispose. Also copy (not refer) 

Modified: trunk/libgdiplus/src/image.c
===================================================================
--- trunk/libgdiplus/src/image.c        2006-03-19 16:37:21 UTC (rev 58159)
+++ trunk/libgdiplus/src/image.c        2006-03-19 16:43:38 UTC (rev 58160)
@@ -708,8 +708,9 @@
 
        for (cnt = 0, encoder = encoders; cnt < numEncoders; encoder++) {
                if (memcmp (&encoder->Clsid, encoderCLSID, sizeof (GUID)) == 0) 
{
+                       ImageFormat ifmt = gdip_image_format_for_format_guid 
(&encoder->FormatID);
                        GdipFree (encoders);
-                       return gdip_image_format_for_format_guid 
(&encoder->FormatID);
+                       return ifmt;
                }
        }
 

Modified: trunk/libgdiplus/src/lineargradientbrush.c
===================================================================
--- trunk/libgdiplus/src/lineargradientbrush.c  2006-03-19 16:37:21 UTC (rev 
58159)
+++ trunk/libgdiplus/src/lineargradientbrush.c  2006-03-19 16:43:38 UTC (rev 
58160)
@@ -342,8 +342,8 @@
 
        linear->pattern = cairo_pattern_create_for_surface (gradient);
        cairo_surface_destroy (gradient);
+       GdipDeleteMatrix (tempMatrix);
 
-
        return Ok;
 }
 
@@ -704,6 +704,7 @@
                        cairo_set_source (ct, linear->pattern);
 
                        status = gdip_get_status (cairo_status (ct));
+                       GdipDeleteMatrix (product);
                }
                else
                        status = GenericError;
@@ -859,19 +860,16 @@
 GpStatus
 GdipCreateLineBrushFromRectWithAngleI (GDIPCONST GpRect *rect, ARGB color1, 
ARGB color2, float angle, BOOL isAngleScalable, GpWrapMode wrapMode, 
GpLineGradient **lineGradient)
 {
-       GpRectF *rectf;
+       GpRectF rectf;
 
        g_return_val_if_fail (rect != NULL, InvalidParameter);
 
-       rectf = (GpRectF *) GdipAlloc (sizeof (GpRectF));
-       g_return_val_if_fail (rectf != NULL, OutOfMemory);
+       rectf.X = rect->X;
+       rectf.Y = rect->Y;
+       rectf.Width = rect->Width;
+       rectf.Height = rect->Height;
 
-       rectf->X = rect->X;
-       rectf->Y = rect->Y;
-       rectf->Width = rect->Width;
-       rectf->Height = rect->Height;
-
-       return GdipCreateLineBrushFromRectWithAngle (rectf, color1, color2, 
angle, 
+       return GdipCreateLineBrushFromRectWithAngle (&rectf, color1, color2, 
angle, 
                                                     isAngleScalable, wrapMode, 
lineGradient);
 }
 

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

Reply via email to