fixed z-order problems in poly2bitmap
[swftools.git] / lib / gfximage.c
index 58f18b3..b47031f 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <math.h>
 #include <memory.h>
 #include "jpeg.h"
@@ -18,6 +19,7 @@ void gfximage_save_jpeg(gfximage_t*img, const char*filename, int quality)
        data[s+2] = img->data[t].b;
     }
     jpeg_save(data, img->width, img->height, quality, filename);
+    free(data);
 }
 
 void gfximage_save_png(gfximage_t*image, const char*filename)
@@ -340,3 +342,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);
+}
+