summaryrefslogtreecommitdiffstats
path: root/libdimension/png.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-05 19:18:24 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-05 19:18:24 +0000
commitf0caa7d190e51af9ba4a487dc371b56174d56f31 (patch)
treedf7126c72187056d36478c43e878137303b3d156 /libdimension/png.c
parent32216655e1d8e523cf3e1239000442b2a30da193 (diff)
downloaddimension-f0caa7d190e51af9ba4a487dc371b56174d56f31.tar.xz
Make optimizer registration fail if a canvas has already been written
to.
Diffstat (limited to 'libdimension/png.c')
-rw-r--r--libdimension/png.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libdimension/png.c b/libdimension/png.c
index c8ffc62..76308ca 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -54,7 +54,10 @@ dmnsn_png_optimize_canvas(dmnsn_canvas *canvas)
return 1;
}
- dmnsn_optimize_canvas(canvas, optimizer);
+ if (dmnsn_optimize_canvas(canvas, optimizer) != 0) {
+ free(optimizer.ptr);
+ return 1;
+ }
return 0;
}