summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gdimagecrop/CMakeLists.txt6
-rw-r--r--tests/gif/.gitignore1
-rw-r--r--tests/gif/CMakeLists.txt1
-rw-r--r--tests/gif/Makemodule.am2
-rw-r--r--tests/gif/gif_nocolormaps.c25
-rw-r--r--tests/gif/gif_nocolormaps.gifbin0 -> 37 bytes
6 files changed, 35 insertions, 0 deletions
diff --git a/tests/gdimagecrop/CMakeLists.txt b/tests/gdimagecrop/CMakeLists.txt
index 43f6f6c..f5c309e 100644
--- a/tests/gdimagecrop/CMakeLists.txt
+++ b/tests/gdimagecrop/CMakeLists.txt
@@ -7,4 +7,10 @@ LIST(APPEND TESTS_FILES
bug00486
)
+IF(PNG_FOUND)
+LIST(APPEND TESTS_FILES
+ bug00486
+)
+ENDIF(PNG_FOUND)
+
ADD_GD_TESTS()
diff --git a/tests/gif/.gitignore b/tests/gif/.gitignore
index 1b07664..d30118f 100644
--- a/tests/gif/.gitignore
+++ b/tests/gif/.gitignore
@@ -8,6 +8,7 @@
/bug00499
/gif_im2im
/gif_null
+/gif_nocolormaps
/ossfuzz5700
/php_bug_75571
/uninitialized_memory_read
diff --git a/tests/gif/CMakeLists.txt b/tests/gif/CMakeLists.txt
index c4b9007..d071874 100644
--- a/tests/gif/CMakeLists.txt
+++ b/tests/gif/CMakeLists.txt
@@ -4,6 +4,7 @@ LIST(APPEND TESTS_FILES
bug00227
bug00499
gif_null
+ gif_nocolormaps
ossfuzz5700
php_bug_75571
uninitialized_memory_read
diff --git a/tests/gif/Makemodule.am b/tests/gif/Makemodule.am
index 9306b71..c616b3e 100644
--- a/tests/gif/Makemodule.am
+++ b/tests/gif/Makemodule.am
@@ -4,6 +4,7 @@ libgd_test_programs += \
gif/bug00227 \
gif/bug00499 \
gif/gif_null \
+ gif/gif_nocolormaps \
gif/ossfuzz5700 \
gif/php_bug_75571 \
gif/uninitialized_memory_read \
@@ -27,6 +28,7 @@ EXTRA_DIST += \
gif/bug00060.gif \
gif/bug00066.gif \
gif/bug00066_exp.png \
+ gif/gif_nocolormaps.gif \
gif/ossfuzz5700.gif \
gif/php_bug_75571.gif \
gif/unitialized_memory_read.gif
diff --git a/tests/gif/gif_nocolormaps.c b/tests/gif/gif_nocolormaps.c
new file mode 100644
index 0000000..4419904
--- /dev/null
+++ b/tests/gif/gif_nocolormaps.c
@@ -0,0 +1,25 @@
+/**
+ * Ensure that a GIF without any Global or Local color tables is still decoded
+ *
+ * GIF89a spec indicates conforming image files need not have Global or Local color tables at all
+ *
+ * See also: https://www.w3.org/Graphics/GIF/spec-gif89a.txt
+ * http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
+ */
+
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+ gdImagePtr im;
+ FILE *fp;
+
+ fp = gdTestFileOpen2("gif", "gif_nocolormaps.gif");
+ gdTestAssert(fp != NULL);
+ im = gdImageCreateFromGif(fp);
+ gdTestAssert(im != NULL);
+ fclose(fp);
+
+ return gdNumFailures();
+}
diff --git a/tests/gif/gif_nocolormaps.gif b/tests/gif/gif_nocolormaps.gif
new file mode 100644
index 0000000..b3aa80d
--- /dev/null
+++ b/tests/gif/gif_nocolormaps.gif
Binary files differ