summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-2.1.0/tests/xpm/bug00185.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/gd/libgd-2.1.0/tests/xpm/bug00185.c')
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/xpm/bug00185.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/xpm/bug00185.c b/Build/source/libs/gd/libgd-2.1.0/tests/xpm/bug00185.c
new file mode 100644
index 00000000000..2dda809cc96
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/xpm/bug00185.c
@@ -0,0 +1,25 @@
+/* $Id$ */
+#include "gd.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "gdtest.h"
+
+/* To check memory leaks, run such as 'valgrind --leak-check=full ./bug00185' */
+int
+main()
+{
+ gdImagePtr im;
+ char path[1024];
+
+ sprintf(path, "%s/xpm/bug00185.xpm", GDTEST_TOP_DIR);
+ im = gdImageCreateFromXpm(path);
+ if (!im) return 1;
+ gdImageDestroy(im);
+
+ sprintf(path, "%s/xpm/bug00185_damaged.xpm", GDTEST_TOP_DIR);
+ im = gdImageCreateFromXpm(path);
+ if (!im) return 0;
+ gdImageDestroy(im);
+
+ return 2;
+}