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 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) { |