summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug66339-mb.phpt
blob: 76e3af7c8f34ae133049f9e0319792c375d63016 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--TEST--
Bug #66339 (PHP segfaults in imagexbm)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$im = imagecreate(8, 8);
imagecolorallocate($im, 0, 0, 0); // background
$white = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 2, 2, 6, 6, $white);
imagexbm($im, NULL);
echo "------------\n";
imagexbm($im, './bug66339私はガラスを食べられます.xbm');
echo file_get_contents('./bug66339私はガラスを食べられます.xbm');
?>
--CLEAN--
<?php
unlink('./bug66339私はガラスを食べられます.xbm');
?>
--EXPECTF--
#define image_width 8
#define image_height 8
static unsigned char image_bits[] = {
  0xFF, 0xFF, 0x83, 0x83, 0x83, 0x83, 0x83, 0xFF};
------------
#define bug66339%swidth 8
#define bug66339%sheight 8
static unsigned char bug66339%sbits[] = {
  0xFF, 0xFF, 0x83, 0x83, 0x83, 0x83, 0x83, 0xFF};