diff options
Diffstat (limited to 'lib/private/image.php')
-rw-r--r-- | lib/private/image.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/image.php b/lib/private/image.php index 0dff8c5a9da..7ddc8dca143 100644 --- a/lib/private/image.php +++ b/lib/private/image.php @@ -603,6 +603,7 @@ class OC_Image { $meta = unpack('vtype/Vfilesize/Vreserved/Voffset', fread($fh, 14)); // check for bitmap if ($meta['type'] != 19778) { + fclose($fh); trigger_error('imagecreatefrombmp: ' . $fileName . ' is not a bitmap!', E_USER_WARNING); return false; } @@ -626,6 +627,7 @@ class OC_Image { if ($meta['imagesize'] < 1) { $meta['imagesize'] = @filesize($fileName) - $meta['offset']; if ($meta['imagesize'] < 1) { + fclose($fh); trigger_error('imagecreatefrombmp: Can not obtain filesize of ' . $fileName . '!', E_USER_WARNING); return false; } @@ -666,6 +668,7 @@ class OC_Image { break; case 16: if (!($part = substr($data, $p, 2))) { + fclose($fh); trigger_error($error, E_USER_WARNING); return $im; } @@ -712,6 +715,7 @@ class OC_Image { $color[1] = $palette[ $color[1] + 1 ]; break; default: + fclose($fh); trigger_error('imagecreatefrombmp: ' . $fileName . ' has ' . $meta['bits'] . ' bits and this is not supported!', E_USER_WARNING); |