diff options
author | Gabor Buella <gbuella@gmail.com> | 2014-04-05 00:17:25 +0200 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2014-04-13 15:17:04 -0700 |
commit | 1010200da5da81642bec89d9c90d001478e3554d (patch) | |
tree | 5edabf6b76d699551682718d5af88e5345a69380 /ext/standard/image.c | |
parent | beda5093b490e80f631f14555bba7216c284a2c3 (diff) | |
download | php-git-1010200da5da81642bec89d9c90d001478e3554d.tar.gz |
Fixed bug #67024 - getimagesize should recognize BMP files with negative height
Diffstat (limited to 'ext/standard/image.c')
-rw-r--r-- | ext/standard/image.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c index 27f60c95a7..816de44d4c 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -163,6 +163,7 @@ static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC) result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo)); result->width = (((unsigned int)dim[ 7]) << 24) + (((unsigned int)dim[ 6]) << 16) + (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]); result->height = (((unsigned int)dim[11]) << 24) + (((unsigned int)dim[10]) << 16) + (((unsigned int)dim[ 9]) << 8) + ((unsigned int) dim[ 8]); + result->height = abs((int32_t)result->height); result->bits = (((unsigned int)dim[15]) << 8) + ((unsigned int)dim[14]); } else { return NULL; |