@@ -2004,20 +2004,20 @@ void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
2004
2004
/* stack of filled segments */
2005
2005
struct seg * stack ;
2006
2006
struct seg * sp ;
2007
+ char * * pts ;
2007
2008
2008
- int * * pts ;
2009
- if (!im -> tile ){
2009
+ if (!im -> tile ) {
2010
2010
return ;
2011
2011
}
2012
2012
2013
2013
wx2 = im -> sx ;wy2 = im -> sy ;
2014
2014
tiled = nc == gdTiled ;
2015
2015
2016
2016
nc = gdImageTileGet (im ,x ,y );
2017
- pts = (int * * ) ecalloc (sizeof (int * ) * im -> sy , sizeof (int ));
2017
+ pts = (char * * ) ecalloc (sizeof (char * ) * im -> sy , sizeof (char ));
2018
2018
2019
2019
for (i = 0 ; i < im -> sy ;i ++ ) {
2020
- pts [i ] = (int * ) ecalloc (im -> sx , sizeof (int ));
2020
+ pts [i ] = (char * ) ecalloc (im -> sx , sizeof (char ));
2021
2021
}
2022
2022
2023
2023
stack = (struct seg * )safe_emalloc (sizeof (struct seg ), ((int )(im -> sy * im -> sx )/4 ), 1 );
@@ -2032,10 +2032,6 @@ void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
2032
2032
while (sp > stack ) {
2033
2033
FILL_POP (y , x1 , x2 , dy );
2034
2034
for (x = x1 ; x >=0 && (!pts [y ][x ] && gdImageGetPixel (im ,x ,y )== oc ); x -- ) {
2035
- if (pts [y ][x ]){
2036
- /* we should never be here */
2037
- break ;
2038
- }
2039
2035
nc = gdImageTileGet (im ,x ,y );
2040
2036
pts [y ][x ]= 1 ;
2041
2037
gdImageSetPixel (im ,x , y , nc );
@@ -2051,11 +2047,7 @@ void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
2051
2047
}
2052
2048
x = x1 + 1 ;
2053
2049
do {
2054
- for (; x <=wx2 && (!pts [y ][x ] && gdImageGetPixel (im ,x , y )== oc ) ; x ++ ) {
2055
- if (pts [y ][x ]){
2056
- /* we should never be here */
2057
- break ;
2058
- }
2050
+ for (; x < wx2 && (!pts [y ][x ] && gdImageGetPixel (im ,x , y )== oc ) ; x ++ ) {
2059
2051
nc = gdImageTileGet (im ,x ,y );
2060
2052
pts [y ][x ]= 1 ;
2061
2053
gdImageSetPixel (im , x , y , nc );
0 commit comments