xref: /PHP-8.1/ext/gd/tests/bug73549.phpt (revision a375d547)
1--TEST--
2Bug #73549 (Use after free when stream is passed to imagepng)
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7$stream = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png', 'w');
8$im = imagecreatetruecolor(8, 8);
9var_dump(imagepng($im, $stream));
10var_dump($stream);
11?>
12--EXPECTF--
13bool(true)
14resource(%d) of type (stream)
15--CLEAN--
16<?php
17unlink(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png');
18?>
19