[Pkg-owncloud-commits] [owncloud] 02/14: Added error check to lib/private/image.php

David Prévot taffit at moszumanska.debian.org
Wed Mar 11 15:49:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v6.0.7
in repository owncloud.

commit 441cdccc3ecab5255875d35d573d430400cb312d
Author: Byron Marohn <combustible at live.com>
Date:   Mon Sep 15 16:12:07 2014 -0700

    Added error check to lib/private/image.php
    
    This checks that imagecreatetruecolor actually creates an image, rather than returning FALSE.
    Without this check, subsequent loop might create billions of ERROR-level log messages.
    
    Signed-off-by: Byron Marohn <combustible at live.com>
---
 lib/private/image.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/private/image.php b/lib/private/image.php
index 4b4dc73..e042f27 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -653,6 +653,12 @@ class OC_Image {
 		}
 		// create gd image
 		$im = imagecreatetruecolor($meta['width'], $meta['height']);
+		if ($im == FALSE) {
+			fclose($fh);
+			trigger_error('imagecreatefrombmp(): imagecreatetruecolor failed for file "' . $fileName . '" with dimensions ' . $meta['width'] . 'x' . $meta['height'], E_USER_WARNING);
+			return FALSE;
+		}
+
 		$data = fread($fh, $meta['imagesize']);
 		$p = 0;
 		$vide = chr(0);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list