com php-src: Fixed Bug #64961 segfault in imagesetinterpolation: ext/gd/gd.c
| From: | Remi Collet | Date: | Mon, 03 Jun 2013 12:15:18 +0000 |
| Subject: | com php-src: Fixed Bug #64961 segfault in imagesetinterpolation: ext/gd/gd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72283@lists.php.net to get a copy of this message | ||
Commit: 99ea60c2ddafcbd6daf4af766da51d28e167999b
Author: Remi Collet <remi@php.net> Mon, 3 Jun 2013 14:15:18 +0200
Parents: ad135fc69ffe4298ea43d8b8996f3b055c2abf0c
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=99ea60c2ddafcbd6daf4af766da51d28e167999b
Log:
Fixed Bug #64961 segfault in imagesetinterpolation
enum type are not long ;) so cannot be used as zend_parse_parameters arg.
Bugs:
https://bugs.php.net/64961
Changed paths:
M ext/gd/gd.c
Diff:
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index d6d2848..7343430 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -5212,7 +5212,7 @@ PHP_FUNCTION(imageaffine)
PHP_FUNCTION(imageaffinematrixget)
{
double affine[6];
- gdAffineStandardMatrix type;
+ long type;
zval *options;
zval **tmp;
int res = GD_FALSE, i;
@@ -5221,7 +5221,7 @@ PHP_FUNCTION(imageaffinematrixget)
return;
}
- switch(type) {
+ switch((gdAffineStandardMatrix)type) {
case GD_AFFINE_TRANSLATE:
case GD_AFFINE_SCALE: {
double x, y;
@@ -5271,7 +5271,7 @@ PHP_FUNCTION(imageaffinematrixget)
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", type);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %li", type);
RETURN_FALSE;
}
@@ -5361,7 +5361,7 @@ PHP_FUNCTION(imagesetinterpolation)
{
zval *IM;
gdImagePtr im;
- gdInterpolationMethod method = GD_BILINEAR_FIXED;
+ long method = GD_BILINEAR_FIXED;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &IM, &method) ==
FAILURE) {
return;