diff options
author | Samuel CHEMLA <chemla.samuel@gmail.com> | 2019-09-01 22:13:25 +0200 |
---|---|---|
committer | Samuel CHEMLA <chemla.samuel@gmail.com> | 2019-09-01 22:27:08 +0200 |
commit | 94eb77a535bde17ee3b7c1819c80c686c763b804 (patch) | |
tree | 96b784c0f83b7375637ac766712657cb0375cb8e /lib | |
parent | 503b9c63c34469a0eb90e5c4e9a04a0e6fe330c0 (diff) | |
download | nextcloud-server-94eb77a535bde17ee3b7c1819c80c686c763b804.tar.gz nextcloud-server-94eb77a535bde17ee3b7c1819c80c686c763b804.zip |
Fix sanity checks #16963
Signed-off-by: Samuel CHEMLA <chemla.samuel@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/legacy/image.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/legacy/image.php b/lib/private/legacy/image.php index d9af45f2226..2efde2ee688 100644 --- a/lib/private/legacy/image.php +++ b/lib/private/legacy/image.php @@ -878,10 +878,8 @@ class OC_Image implements \OCP\IImage { $widthOrig = imagesx($this->resource); $heightOrig = imagesy($this->resource); $process = imagecreatetruecolor($width, $height); - - if ($process == false) { + if ($process === false) { $this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core')); - imagedestroy($process); return false; } @@ -892,8 +890,8 @@ class OC_Image implements \OCP\IImage { imagesavealpha($process, true); } - imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig); - if ($process == false) { + $res = imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig); + if ($res === false) { $this->logger->error(__METHOD__ . '(): Error re-sampling process image', array('app' => 'core')); imagedestroy($process); return false; |