bug66339.phpt 718 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #66339 (PHP segfaults in imagexbm)
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $im = imagecreate(8, 8);
  8. imagecolorallocate($im, 0, 0, 0); // background
  9. $white = imagecolorallocate($im, 255, 255, 255);
  10. imagefilledrectangle($im, 2, 2, 6, 6, $white);
  11. imagexbm($im, NULL);
  12. echo "------------\n";
  13. imagexbm($im, './bug66339.xbm');
  14. echo file_get_contents('./bug66339.xbm');
  15. ?>
  16. --CLEAN--
  17. <?php
  18. unlink('./bug66339.xbm');
  19. ?>
  20. --EXPECT--
  21. #define image_width 8
  22. #define image_height 8
  23. static unsigned char image_bits[] = {
  24. 0xFF, 0xFF, 0x83, 0x83, 0x83, 0x83, 0x83, 0xFF};
  25. ------------
  26. #define bug66339_width 8
  27. #define bug66339_height 8
  28. static unsigned char bug66339_bits[] = {
  29. 0xFF, 0xFF, 0x83, 0x83, 0x83, 0x83, 0x83, 0xFF};