From 9af25b7e9c3813f1d33a911cd99bc73f24a34248 Mon Sep 17 00:00:00 2001 From: Sam Lawrance Date: Mon, 17 Oct 2005 13:58:21 +0000 Subject: Add in a null-pointer check to fail with an error message when fly is given an input file of the wrong type (or a corrupt file). Bump PORTREVISION. PR: ports/86137 Submitted by: Nick Fishman --- graphics/fly/files/patch-fly.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 graphics/fly/files/patch-fly.c (limited to 'graphics/fly/files/patch-fly.c') diff --git a/graphics/fly/files/patch-fly.c b/graphics/fly/files/patch-fly.c new file mode 100644 index 000000000000..8dbccf2e1c38 --- /dev/null +++ b/graphics/fly/files/patch-fly.c @@ -0,0 +1,14 @@ +--- fly.c.orig Sun Nov 25 19:39:28 2001 ++++ fly.c Mon Oct 17 23:48:51 2005 +@@ -1270,6 +1270,11 @@ + } else { + img_file = gdImageCreateFromPng(img_to_copy); + } ++ if (img_file == NULL) { ++ fprintf(stderr, "Error: Cannot read image file \"%s\" of type \"%s\"\n", ++ filename, imgtype == GIF ? "gif" : (imgtype == JPEG ? "jpeg" : "png")); ++ exit(1); ++ } + fclose(img_to_copy); + + if( resize == 1 ) -- cgit v1.2.3