mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(preview-generator): Throw exception before dividing by zero when generating previews
If the maximum preview generated gives some kind of invalid IImage, it's dimentions and filename can be set to zero. And then later we do a division by zero to keep the aspect ratio of the previews. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
8f0849a317
commit
e60888d988
1 changed files with 4 additions and 0 deletions
|
|
@ -170,6 +170,10 @@ class Generator {
|
|||
|
||||
[$maxWidth, $maxHeight] = $this->getPreviewSize($maxPreview, $previewVersion);
|
||||
|
||||
if ($maxWidth <= 0 || $maxHeight <= 0) {
|
||||
throw new NotFoundException('The maximum preview sizes are zero or less pixels');
|
||||
}
|
||||
|
||||
$preview = null;
|
||||
|
||||
foreach ($specifications as $specification) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue