diff options
| author | Scott MacVicar <scottmac@php.net> | 2011-05-13 05:06:48 +0000 |
|---|---|---|
| committer | Scott MacVicar <scottmac@php.net> | 2011-05-13 05:06:48 +0000 |
| commit | 194b48088cf0f0017f1b6b0b53203d8e0e5ef0b0 (patch) | |
| tree | fa0c926016142b8d4de7aea6ad0c63a15ccc4cb8 | |
| parent | 155972b11725ff29317f6e3ed12c65e02ee8f5c4 (diff) | |
| download | php-git-194b48088cf0f0017f1b6b0b53203d8e0e5ef0b0.tar.gz | |
Fixed bug #54723 - getimagesize() doesn't check the full ico signature and misreports mpg files
| -rw-r--r-- | ext/standard/image.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c index a05bd9210c..538366788a 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -51,7 +51,7 @@ PHPAPI const char php_sig_jp2[12] = {(char)0x00, (char)0x00, (char)0x00, (char)0 (char)0x6a, (char)0x50, (char)0x20, (char)0x20, (char)0x0d, (char)0x0a, (char)0x87, (char)0x0a}; PHPAPI const char php_sig_iff[4] = {'F','O','R','M'}; -PHPAPI const char php_sig_ico[3] = {(char)0x00, (char)0x00, (char)0x01}; +PHPAPI const char php_sig_ico[4] = {(char)0x00, (char)0x00, (char)0x01, (char)0x00}; /* REMEMBER TO ADD MIME-TYPE TO FUNCTION php_image_type_to_mime_type */ /* PCX must check first 64bytes and byte 0=0x0a and byte2 < 0x06 */ @@ -1265,7 +1265,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) return IMAGE_FILETYPE_TIFF_MM; } else if (!memcmp(filetype, php_sig_iff, 4)) { return IMAGE_FILETYPE_IFF; - } else if (!memcmp(filetype, php_sig_ico, 3)) { + } else if (!memcmp(filetype, php_sig_ico, 4)) { return IMAGE_FILETYPE_ICO; } |
