diff options
author | Byron Marohn <combustible@live.com> | 2014-09-16 03:12:07 +0400 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-02 10:48:59 +0300 |
commit | 8778af681cb3a17068a47d9afb916f8155b66a55 (patch) | |
tree | 3725e131b8a5bfa182aa325ee566b6b3f3089c7b /lib/private | |
parent | fb63e75743cae8de15372df88f1f04bf73404981 (diff) |
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@live.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/image.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/image.php b/lib/private/image.php index c055c693f62..967c632ac26 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); |