mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
- fixed size information for _php_sig_png array
- removed extra memcmp step in signature comparison, this seemed to have been inherited from ext/standard/image.c but is not needed here as the provided buffer is big enough from the start
This commit is contained in:
parent
b0f461e9d9
commit
dd659ea648
2 changed files with 3 additions and 5 deletions
|
@ -1254,10 +1254,8 @@ static int _php_image_type (char data[8])
|
|||
return PHP_GDIMG_TYPE_GD2;
|
||||
} else if (!memcmp(data, php_sig_jpg, 3)) {
|
||||
return PHP_GDIMG_TYPE_JPG;
|
||||
} else if (!memcmp(data, php_sig_png, 3)) {
|
||||
if (!memcmp(data, php_sig_png, 8)) {
|
||||
} else if (!memcmp(data, php_sig_png, 8)) {
|
||||
return PHP_GDIMG_TYPE_PNG;
|
||||
}
|
||||
} else if (!memcmp(data, php_sig_gif, 3)) {
|
||||
return PHP_GDIMG_TYPE_GIF;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
PHPAPI extern const char php_sig_gif[3];
|
||||
PHPAPI extern const char php_sig_jpg[3];
|
||||
PHPAPI extern const char php_sig_png[3];
|
||||
PHPAPI extern const char php_sig_png[8];
|
||||
|
||||
extern zend_module_entry gd_module_entry;
|
||||
#define phpext_gd_ptr &gd_module_entry
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue