bug77272.phpt 552 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #77272 (imagescale() may return image resource on failure)
  3. --INI--
  4. memory_limit=-1
  5. --EXTENSIONS--
  6. gd
  7. --SKIPIF--
  8. <?php
  9. if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
  10. if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
  11. ?>
  12. --FILE--
  13. <?php
  14. $img = imagecreate(2**28, 1);
  15. var_dump(imagescale($img, 1, 1, IMG_TRIANGLE));
  16. ?>
  17. --EXPECTF--
  18. Warning: imagescale():%S Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
  19. in %s on line %d
  20. bool(false)