bug74435.phpt 672 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #74435 (Buffer over-read into uninitialized memory)
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $im = imagecreatefromgif(__DIR__ . DIRECTORY_SEPARATOR . 'bug74435.gif');
  8. var_dump($im);
  9. $width = imagesx($im);
  10. $height = imagesy($im);
  11. for ($i = 0; $i < $width; $i += 16) {
  12. for ($j = 0; $j < $height; $j += 16) {
  13. if (($index = imagecolorat($im, $i, $j)) >= 2) {
  14. list($red, $green, $blue, $alpha) = array_values(imagecolorsforindex($im, $index));
  15. if ($red !== 0 || $green !== 0 || $blue !== 0 || $alpha !== 0) {
  16. echo "unexpected color at ($i, $j)\n";
  17. }
  18. }
  19. }
  20. }
  21. ?>
  22. --EXPECT--
  23. object(GdImage)#1 (0) {
  24. }