Issue 14419: Avoid fatal errors with animated WebP images and GDlib

This commit is contained in:
Michael 2024-09-18 04:06:57 +00:00
parent 38ff423716
commit 7525d80d03

View file

@ -213,6 +213,12 @@ class Image
}
$this->valid = false;
if (($this->originType == IMAGETYPE_WEBP) && $this->isAnimatedWebP(substr($data, 0, 90))) {
DI::logger()->notice('Animated WebP images are unsupported by GDlib. Please install Imagick.', ['file' => $this->filename]);
return false;
}
try {
$this->image = @imagecreatefromstring($data);
if ($this->image !== false) {