bug72730.phpt 338 B

123456789101112131415161718
  1. --TEST--
  2. Bug #72730: imagegammacorrect allows arbitrary write access
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. require __DIR__ . '/func.inc';
  8. $img = imagecreatetruecolor(1, 1);
  9. trycatch_dump(
  10. fn() => imagegammacorrect($img, -1, 1337)
  11. );
  12. ?>
  13. --EXPECT--
  14. !! [ValueError] imagegammacorrect(): Argument #2 ($input_gamma) must be greater than 0