summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@xcc.kaivo.net>2018-11-15 16:01:16 -0500
committerJakob Kaivo <jkk@xcc.kaivo.net>2018-11-15 16:01:16 -0500
commite791b3713a8e9932e48dcb141275d11acc199538 (patch)
tree02d814ecbd52723e823c9fd418dafe287159562a
parent6d5b39e764a89e039d8bddddfde9f3730e3a7af5 (diff)
more error checking
-rw-r--r--convert.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/convert.c b/convert.c
index f64f7f6..1afafd0 100644
--- a/convert.c
+++ b/convert.c
@@ -10,8 +10,22 @@ int convert(const char *in, const char *out, int width, int height)
if (!IsMagickWandInstantiated()) {
MagickWandGenesis();
+ }
+
+ if (w == NULL) {
w = NewMagickWand();
+ if (w == NULL) {
+ printf("couldn't create MagickWand\n");
+ return 1;
+ }
+ }
+
+ if (pixel == NULL) {
pixel = NewPixelWand();
+ if (pixel == NULL) {
+ printf("couldn't create PixelWand\n");
+ return 1;
+ }
}
if (!MagickReadImage(w, in)) {