--- embedaddon/php/ext/standard/image.c 2013/10/14 08:02:34 1.1.1.4 +++ embedaddon/php/ext/standard/image.c 2014/06/15 20:03:57 1.1.1.5 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: image.c,v 1.1.1.4 2013/10/14 08:02:34 misho Exp $ */ +/* $Id: image.c,v 1.1.1.5 2014/06/15 20:03:57 misho Exp $ */ #include "php.h" #include @@ -30,6 +30,9 @@ #include #endif #include "php_image.h" +#ifdef PHP_WIN32 +#include "win32/php_stdint.h" +#endif #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) #include "zlib.h" @@ -163,6 +166,7 @@ static struct gfxinfo *php_handle_bmp (php_stream * st 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;