bug72697.phpt 486 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #72697: select_colors write out-of-bounds
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (PHP_INT_MAX !== 9223372036854775807) die("skip for 64-bit long systems only");
  8. ?>
  9. --FILE--
  10. <?php
  11. require __DIR__ . '/func.inc';
  12. $img=imagecreatetruecolor(10, 10);
  13. trycatch_dump(
  14. fn() => imagetruecolortopalette($img, false, PHP_INT_MAX / 8)
  15. );
  16. ?>
  17. DONE
  18. --EXPECT--
  19. !! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be greater than 0 and less than 2147483647
  20. DONE