summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug39780.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/tests/bug39780.phpt')
-rw-r--r--ext/gd/tests/bug39780.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/gd/tests/bug39780.phpt b/ext/gd/tests/bug39780.phpt
new file mode 100644
index 000000000..3a23aa9df
--- /dev/null
+++ b/ext/gd/tests/bug39780.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #39780 (PNG image with CRC/data error raises a fatal error)
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available\n");
+ if (!GD_BUNDLED) die('skip external GD libraries always fail');
+?>
+--FILE--
+<?php
+
+$im = imagecreatefrompng(dirname(__FILE__) . '/bug39780.png');
+var_dump($im);
+?>
+--EXPECTF--
+
+Warning: imagecreatefrompng(): gd-png: fatal libpng error: IDAT: CRC error in %s on line %d
+
+Warning: imagecreatefrompng(): gd-png error: setjmp returns error condition in %s on line %d
+
+Warning: imagecreatefrompng(): '%s' is not a valid PNG file in %s on line %d
+bool(false)