aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Image.php
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2021-11-10 15:50:15 +0100
committerszaimen <szaimen@e.mail.de>2021-11-10 15:50:15 +0100
commit3ac316b77fedfbd7edce99de0dd0c974ad6aacb4 (patch)
treeda81e57e0b026e315e46b9eaff3d7706e38f5d48 /lib/private/legacy/OC_Image.php
parent9673579f2097be9cce225a69b804f4f06f124473 (diff)
downloadnextcloud-server-3ac316b77fedfbd7edce99de0dd0c974ad6aacb4.tar.gz
nextcloud-server-3ac316b77fedfbd7edce99de0dd0c974ad6aacb4.zip
fix imagecreatetruecolor() error
Signed-off-by: szaimen <szaimen@e.mail.de>
Diffstat (limited to 'lib/private/legacy/OC_Image.php')
-rw-r--r--lib/private/legacy/OC_Image.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php
index c30ceae9916..b9ef31ed9fa 100644
--- a/lib/private/legacy/OC_Image.php
+++ b/lib/private/legacy/OC_Image.php
@@ -924,6 +924,10 @@ class OC_Image implements \OCP\IImage {
* @return resource|bool|\GdImage
*/
public function preciseResizeNew(int $width, int $height) {
+ if (!($width > 0) || !($height > 0)) {
+ $this->logger->info(__METHOD__ . '(): Requested image size not bigger than 0', ['app' => 'core']);
+ return false;
+ }
if (!$this->valid()) {
$this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
return false;