diff options
-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 47f2952c6e6..fd0a1009663 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -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) { |