cvs: gd(GD_2_0) /libgd NEWS gd.c /libgd/tests CMakeLists.txt /libgd/tests/gdimagecolordeallocate CMakeLists.txt gdimagecolordeallocate.c

[email protected] ("Mattias Bengtsson") Fri, 31 Aug 2007 07:31:03 -0000
Newsgroups php.gd.cvs
Message-ID <cvsmattias1188545463@cvsserver>
mattias		Fri Aug 31 07:31:03 2007 UTC

  Added files:                 (Branch: GD_2_0)
    /gd/libgd/tests/gdimagecolordeallocate	CMakeLists.txt 
                                          	gdimagecolordeallocate.c 

  Modified files:              
    /gd/libgd	gd.c NEWS 
    /gd/libgd/tests	CMakeLists.txt 
  Log:
  - #112, gdImageColorDeallocate can write outside buffer
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.49.2.20&r2=1.49.2.21&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.49.2.20 gd/libgd/gd.c:1.49.2.21
--- gd/libgd/gd.c:1.49.2.20	Thu Aug 30 19:03:54 2007
+++ gd/libgd/gd.c	Fri Aug 31 07:31:03 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.49.2.20 2007/08/30 19:03:54 mattias Exp $ */
+/* $Id: gd.c,v 1.49.2.21 2007/08/31 07:31:03 mattias Exp $ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -589,7 +589,7 @@
 
 BGD_DECLARE(void) gdImageColorDeallocate (gdImagePtr im, int color)
 {
-  if (im->trueColor)
+  if (im->trueColor || (color >= gdMaxColors))
     {
       return;
     }
http://cvs.php.net/viewvc.cgi/gd/libgd/NEWS?r1=1.4.2.31&r2=1.4.2.32&diff_format=u
Index: gd/libgd/NEWS
diff -u gd/libgd/NEWS:1.4.2.31 gd/libgd/NEWS:1.4.2.32
--- gd/libgd/NEWS:1.4.2.31	Thu Aug 30 19:30:21 2007
+++ gd/libgd/NEWS	Fri Aug 31 07:31:03 2007
@@ -8,6 +8,7 @@
 106, gdImageRectangle draws 1x1 rectangles as 1x3 rectangles (Pierre)
 109, Possible integer overflow in gdImageFill() (Mattias Bengtsson)
 111, Optimization for single pixel line not in correct order (Mattias)
+112, gdImageColorDeallocate can write outside buffer (Mattias Bengtsson)
 
 GD 2.0.35 (2007-06-21)
 41, Fix valgrind error in gdImageFillTiled (Nuno Lopes) 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/CMakeLists.txt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: gd/libgd/tests/CMakeLists.txt
diff -u gd/libgd/tests/CMakeLists.txt:1.1.2.1 gd/libgd/tests/CMakeLists.txt:1.1.2.2
--- gd/libgd/tests/CMakeLists.txt:1.1.2.1	Mon May  7 10:21:57 2007
+++ gd/libgd/tests/CMakeLists.txt	Fri Aug 31 07:31:03 2007
@@ -32,6 +32,7 @@
 		gdimagecolorclosest
 		gdimagecolorexact
 		gdimagecolorresolve
+		gdimagecolordeallocate
 		#gdimageellipse
 		gdimageline
 		gdimagefilledellipse
@@ -51,4 +52,4 @@
 	FOREACH(test_dir ${TESTS_DIRS})
 		add_subdirectory (${test_dir})
 	ENDFOREACH(test_dir)
-endif (BUILD_TEST)
\ No newline at end of file
+endif (BUILD_TEST)

http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagecolordeallocate/CMakeLists.txt?view=markup&rev=1.1
Index: gd/libgd/tests/gdimagecolordeallocate/CMakeLists.txt
+++ gd/libgd/tests/gdimagecolordeallocate/CMakeLists.txt

http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagecolordeallocate/gdimagecolordeallocate.c?view=markup&rev=1.1
Index: gd/libgd/tests/gdimagecolordeallocate/gdimagecolordeallocate.c
+++ gd/libgd/tests/gdimagecolordeallocate/gdimagecolordeallocate.c