git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed restitching bug
[swftools.git]
/
lib
/
gfximage.c
diff --git
a/lib/gfximage.c
b/lib/gfximage.c
index
58f18b3
..
b47031f
100644
(file)
--- a/
lib/gfximage.c
+++ b/
lib/gfximage.c
@@
-1,3
+1,4
@@
+#include <stdlib.h>
#include <math.h>
#include <memory.h>
#include "jpeg.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);
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)
}
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;
}
image2->height = newheight;
return image2;
}
+
+void gfximage_free(gfximage_t*b)
+{
+ free(b->data);
+ b->data = 0;
+ free(b);
+}
+