mirror of
https://github.com/nextcloud/server.git
synced 2026-03-01 04:50:40 -05:00
Merge pull request #38959 from nextcloud/fix/oc-image-bmp-no-color
[stable25] fix: BMP image without color info causes array access on `false`
This commit is contained in:
commit
54885eaeb3
1 changed files with 5 additions and 0 deletions
|
|
@ -931,6 +931,11 @@ class OC_Image implements \OCP\IImage {
|
|||
break;
|
||||
case 8:
|
||||
$color = @unpack('n', $vide . ($data[$p] ?? ''));
|
||||
if ($color === false) {
|
||||
fclose($fh);
|
||||
$this->logger->warning('Invalid 8bit bmp without color', ['app' => 'core']);
|
||||
return false;
|
||||
}
|
||||
$color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1];
|
||||
break;
|
||||
case 4:
|
||||
|
|
|
|||
Loading…
Reference in a new issue