Commit fa9b36b7 authored by Byron Marohn's avatar Byron Marohn Committed by Thomas Müller
Browse files

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: default avatarByron Marohn <combustible@live.com>
parent 8db4dd75
...@@ -658,6 +658,12 @@ class OC_Image { ...@@ -658,6 +658,12 @@ class OC_Image {
} }
// create gd image // create gd image
$im = imagecreatetruecolor($meta['width'], $meta['height']); $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']); $data = fread($fh, $meta['imagesize']);
$p = 0; $p = 0;
$vide = chr(0); $vide = chr(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment