-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I ran into a situation with an ico image where IcoParser->isPNG($data) passed, but then imagecreatefromstring($data) failed. The result is that in parsePNGAsIco() it crashes with a fatal error when it gets to the imagesx(false) line. Here is the bug fix:
private function parsePNGAsIco($data)
{
$png = imagecreatefromstring($data);
+ if (!$png) {
+ throw new \InvalidArgumentException('Invalid PNG file format');
+ }
$w = imagesx($png);
$h = imagesy($png);
Here is the icon that triggered the error for me.
favicon.ico.zip
Metadata
Metadata
Assignees
Labels
No labels