[PATCH] GD - imagecolorallocatealpha

From: Date: Mon, 24 Aug 2009 01:44:00 +0000
Subject: [PATCH] GD - imagecolorallocatealpha
Groups: php.internals 
Request: Send a blank email to internals+get-45341@lists.php.net to get a copy of this message
First time suggesting a patch, please correct me if i do something wrong. I was writing tests for imagecolorallocatealpha and noticed a change applied in 5.3 is not in head, that is the validation of the first parameter, delacred as 'r' in 5.3 and 'z' in HEAD (also in 5.2) This is not a absolute problem since there is a resource type validation right after looking for Image Resource. So i don't know how important this fix is, but i wrote the patch below and it worked according to my tests. I will also be commiting the tests in a few minutes. PATCH: Index: ext/gd/gd.c =================================================================== --- ext/gd/gd.c (revision 287587) +++ ext/gd/gd.c (working copy) @@ -1729,7 +1729,7 @@ gdImagePtr im; int ct = (-1); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", &IM, &red, &green, &blue, &alpha) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) { RETURN_FALSE; } Cheers everyone! -- Rafael Dohms PHP Evangelist and Community Leader http://www.rafaeldohms.com.br http://www.phpsp.org.br

« previous php.internals (#45341) next »