diff options
author | Pierre Joye <pierre.php@gmail.com> | 2013-04-04 16:56:13 +0200 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2013-04-04 16:56:13 +0200 |
commit | e5b9482db454434cfbcb698b209e9ab881c7c1cb (patch) | |
tree | 24130d08d4b85582f7db0df28d85db8548f9ca0d | |
parent | e7a8d065f50f8e16a50730a1af85d407ba59dd45 (diff) | |
download | libgd-e5b9482db454434cfbcb698b209e9ab881c7c1cb.tar.gz |
avoid non init'ed im if no png support
-rw-r--r-- | examples/crop.c | 1 | ||||
-rw-r--r-- | src/pngtogd2.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/examples/crop.c b/examples/crop.c index 0eb4182..bafb6df 100644 --- a/examples/crop.c +++ b/examples/crop.c @@ -33,6 +33,7 @@ gdImagePtr read_png(const char *filename) #ifdef HAVE_LIBPNG im = gdImageCreateFromPng(fp); #else + im = NULL; printf("No PNG support. Cannot read image.\n"); #endif fclose(fp); diff --git a/src/pngtogd2.c b/src/pngtogd2.c index 54a8331..fc0b414 100644 --- a/src/pngtogd2.c +++ b/src/pngtogd2.c @@ -33,6 +33,7 @@ main (int argc, char **argv) #ifdef HAVE_LIBPNG im = gdImageCreateFromPng (in); #else + im = NULL; fprintf (stderr, "No PNG library support available.\n"); #endif fclose (in); |