diff options
author | Simon L <szaimen@e.mail.de> | 2023-05-17 00:14:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 00:14:42 +0200 |
commit | 6608f84a461223696810f4568c3f871d9b5209b8 (patch) | |
tree | d5b8475d54a891b2cb5d79feac08b2e743dd370f /lib/private | |
parent | f01d30ad1178b04d9e44250679775fb285c7f7a0 (diff) | |
parent | e60888d98892be22477ea6ace68255d7202dbec8 (diff) | |
download | nextcloud-server-6608f84a461223696810f4568c3f871d9b5209b8.tar.gz nextcloud-server-6608f84a461223696810f4568c3f871d9b5209b8.zip |
Merge pull request #36692 from nextcloud/throw-exception-to-avoid-division-by-zero
fix(preview-generator): Throw exception before dividing by zero when generating previews
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Preview/Generator.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index d19f5d29bf5..9711192d740 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -172,6 +172,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) { |