[PHP-CVS] cvs: php-src(PHP_4_4) / NEWS /ext/gd/libgd gd.c

2007-10-20 Thread Pierre-Alain Joye
pajoye  Sat Oct 20 15:29:04 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-srcNEWS 
/php-src/ext/gd/libgd   gd.c 
  Log:
  - #43010, Fixed regression in imagearc with two equivelent angles
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.1247.2.920.2.243r2=1.1247.2.920.2.244diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.243 php-src/NEWS:1.1247.2.920.2.244
--- php-src/NEWS:1.1247.2.920.2.243 Tue Jul 10 20:26:50 2007
+++ php-src/NEWSSat Oct 20 15:29:03 2007
@@ -14,6 +14,8 @@
   open_basedir or safe_mode is active (Stas)
 - Fixed session.save_path and error_log values to be checked against
   open_basedir and safe_mode (CVE-2007-3378) (Stas, Maksymilian Arciemowicz)
+- Fixed bug #43010 (Fixed regression in imagearc with two equivelent angles)
+  (Pierre)
 - Fixed bug #41765 (Recode crashes/does not work on amd64) 
   (nexus at smoula dot net, Stas)
 - Fixed bug #41630 (segfault when an invalid color index is present in
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.24.2.36.2.2r2=1.24.2.36.2.3diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.24.2.36.2.2 
php-src/ext/gd/libgd/gd.c:1.24.2.36.2.3
--- php-src/ext/gd/libgd/gd.c:1.24.2.36.2.2 Sat Apr 14 17:38:38 2007
+++ php-src/ext/gd/libgd/gd.c   Sat Oct 20 15:29:04 2007
@@ -1607,20 +1607,28 @@
int lx = 0, ly = 0;
int fx = 0, fy = 0;
 
-   if (s  360) {
-   s = s % 360;
-   }
+   if ((s % 360)  == (e % 360)) {
+   s = 0; e = 360;
+   } else {
+   if (s  360) {
+   s = s % 360;
+   }
 
-   if (e  360) {
-   e = e % 360;
-   }
+   if (e  360) {
+   e = e % 360;
+   }
 
-   while (s0) {
-   s += 360;
-   }
+   while (s  0) {
+   s += 360;
+   }
 
-   while (e  s) {
-   e += 360;
+   while (e  s) {
+   e += 360;
+   }
+
+   if (s == e) {
+   s = 0; e = 360;
+   }
}
 
for (i = s; i = e; i++) {

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



[PHP-CVS] cvs: php-src(PHP_4_4) / NEWS /ext/gd/libgd gd.c

2007-04-14 Thread Pierre-Alain Joye
pajoye  Sat Apr 14 17:38:38 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-srcNEWS 
/php-src/ext/gd/libgd   gd.c 
  Log:
  - MFH: libgd #74, gdImageFilledArc, huge CPU usage with large angles
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.1247.2.920.2.222r2=1.1247.2.920.2.223diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.222 php-src/NEWS:1.1247.2.920.2.223
--- php-src/NEWS:1.1247.2.920.2.222 Fri Apr 13 00:55:48 2007
+++ php-src/NEWSSat Apr 14 17:38:38 2007
@@ -3,7 +3,9 @@
 ?? ??? 2007, Version 4.4.7
 - Fixed bug #38236 (binary data gets corrupted on multipart/formdata POST)
   (patch by [EMAIL PROTECTED])
-   
+- Fixed huge CPU usage in imagearc when used with large angles (Pierre)
+  (libgd bug #74)
+
 11 Apr 2007, Version 4.4.7RC1
 - Fixed MOPB-33-2007 (PHP mail() Message ASCIIZ Byte Truncation). (Ilia)
 - Fixed MOPB-32-2007 (Double free inside session_decode()). (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.24.2.36.2.1r2=1.24.2.36.2.2diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.24.2.36.2.1 
php-src/ext/gd/libgd/gd.c:1.24.2.36.2.2
--- php-src/ext/gd/libgd/gd.c:1.24.2.36.2.1 Fri Sep 30 21:05:04 2005
+++ php-src/ext/gd/libgd/gd.c   Sat Apr 14 17:38:38 2007
@@ -1607,6 +1607,14 @@
int lx = 0, ly = 0;
int fx = 0, fy = 0;
 
+   if (s  360) {
+   s = s % 360;
+   }
+
+   if (e  360) {
+   e = e % 360;
+   }
+
while (s0) {
s += 360;
}

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