[PHP-CVS] cvs: php-src /ext/gd/libgd gd_gd2.c

2006-11-04 Thread Pierre-Alain Joye
pajoye  Sat Nov  4 14:29:00 2006 UTC

  Modified files:  
/php-src/ext/gd/libgd   gd_gd2.c 
  Log:
  - MFB: silent compiler warnings
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gd2.c?r1=1.18r2=1.19diff_format=u
Index: php-src/ext/gd/libgd/gd_gd2.c
diff -u php-src/ext/gd/libgd/gd_gd2.c:1.18 php-src/ext/gd/libgd/gd_gd2.c:1.19
--- php-src/ext/gd/libgd/gd_gd2.c:1.18  Wed Jul 26 08:51:53 2006
+++ php-src/ext/gd/libgd/gd_gd2.c   Sat Nov  4 14:29:00 2006
@@ -544,7 +544,7 @@
chunkNum = cx + cy * ncx;
 
chunkLen = chunkMax;
-   if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, 
compBuf, chunkIdx[chunkNum].size, chunkBuf, chunkLen, in)) {
+   if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, 
compBuf, chunkIdx[chunkNum].size, (char *)chunkBuf, chunkLen, in)) {
php_gd_error(Error reading comproessed 
chunk);
goto fail2;
}
@@ -558,7 +558,7 @@
for (x = xlo; x  xhi; x++) {
if (!gd2_compressed(fmt)) {
if (im-trueColor) {
-   if (!gdGetInt(ch, in)) 
{
+   if (!gdGetInt((int 
*)ch, in)) {
ch = 0;
}
} else {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/libgd gd_gd2.c /ext/gd/tests bug38212.phpt

2006-07-26 Thread Pierre-Alain Joye
pajoye  Wed Jul 26 08:51:53 2006 UTC

  Added files: 
/php-src/ext/gd/tests   bug38212.phpt 

  Modified files:  
/php-src/ext/gd/libgd   gd_gd2.c 
  Log:
  - #38212, Segfault on invalid imagecreatefromgd2part() parameters
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gd2.c?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/gd/libgd/gd_gd2.c
diff -u php-src/ext/gd/libgd/gd_gd2.c:1.17 php-src/ext/gd/libgd/gd_gd2.c:1.18
--- php-src/ext/gd/libgd/gd_gd2.c:1.17  Thu Aug 18 12:54:29 2005
+++ php-src/ext/gd/libgd/gd_gd2.c   Wed Jul 26 08:51:53 2006
@@ -430,6 +430,10 @@
 
gdImagePtr im;
 
+   if (w1 || h 1) {
+   return 0;
+   }
+
/* The next few lines are basically copied from gd2CreateFromFile
 * we change the file size, so don't want to use the code directly.
 * but we do need to know the file size.

http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/bug38212.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/bug38212.phpt
+++ php-src/ext/gd/tests/bug38212.phpt
--TEST--
imagecopy doen't copy alpha, palette to truecolor
--SKIPIF--
?php
if (!function_exists('imagecopy')) die(skip gd extension not 
available\n);
?
--FILE--
?php
$file = dirname(__FILE__) . '/bug38212.gd2';
$im1 = imagecreatetruecolor(10,100);
imagefill($im1, 0,0, 0xff);
imagegd2($im1, $file);
$im = imagecreatefromgd2part($file, 0,0, -25,10);
unlink($file);
?
--EXPECTF--
Warning: imagecreatefromgd2part(): '%sbug38212.gd2' is not a valid GD2 file in 
%sbug38212.php on line %d

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php