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

David Prévot taffit at moszumanska.debian.org
Fri Feb 6 21:10:45 UTC 2015


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

taffit pushed a commit to branch master
in repository owncloud.

commit 8778af681cb3a17068a47d9afb916f8155b66a55
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 c055c69..967c632 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -652,6 +652,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