fixed a mem leak
[swftools.git] / lib / gfximage.c
index 54adadc..f1eda7d 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <math.h>
 #include <memory.h>
 #include "jpeg.h"
@@ -6,7 +7,7 @@
 #include "gfximage.h"
 #include "types.h"
 
-void gfximage_save_jpeg(gfximage_t*img, int quality, const char*filename)
+void gfximage_save_jpeg(gfximage_t*img, const char*filename, int quality)
 {
     int x,y;
     int l = img->width*img->height;
@@ -340,3 +341,11 @@ gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight)
     image2->height = newheight;
     return image2;
 }
+
+void gfximage_free(gfximage_t*b)
+{
+    free(b->data);
+    b->data = 0;
+    free(b);
+}
+