We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f50b10 commit c497016Copy full SHA for c497016
ext/gd/tests/gh17772.phpt
@@ -0,0 +1,24 @@
1
+--TEST--
2
+GH-17772 (imagepalettetotruecolor segfault on image deallocation)
3
+--EXTENSIONS--
4
+gd
5
+--INI--
6
+memory_limit=2M
7
+--CREDITS--
8
+YuanchengJiang
9
+--FILE--
10
+<?php
11
+function setStyleAndThickness($im, $color, $thickness)
12
+{
13
+$arr = [];
14
+$i = 0;
15
+while ($i < 16 * $thickness) {
16
+$arer[$i++] = $color;
17
+}
18
19
+$im = imagecreate(800, 800);
20
+setStyleAndThickness($im, 0, 6);
21
+imagepalettetotruecolor($im);
22
+?>
23
+--EXPECTF--
24
+Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
0 commit comments