summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--catgy.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/catgy.c b/catgy.c
index b917005..3722abc 100644
--- a/catgy.c
+++ b/catgy.c
@@ -74,10 +74,16 @@ average(uint8_t dest[3], uint8_t src[9])
static void
blurge(struct image *img)
{
+ struct image copy;
+ if (duplicate(&copy, img))
+ return;
+
for (int y = 0; y < img->h; y++)
for (int x = 1; x < img->w - 1; x++)
average(&img->data[x * 3 + y * img->w * 3],
- &img->data[x * 3 - 3 + y * img->w * 3]);
+ &copy.data[x * 3 - 3 + y * img->w * 3]);
+
+ free(copy.data);
}
static int