summaryrefslogtreecommitdiffstats
path: root/lib/private/image.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/image.php')
-rw-r--r--lib/private/image.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/image.php b/lib/private/image.php
index ecdad084c02..01bca8267e9 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -658,6 +658,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);