|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-04-01 00:12 UTC] rasmus
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Found a small bug in ImageSetPixel in functions/gd.c. See below. It seems that this bug has been here for awhile. (Found it in php3.0b3 too) void php3_imagesetpixel(INTERNAL_FUNCTION_PARAMETERS) { YYSTYPE *imarg, *xarg, *yarg, *colarg; gdImagePtr im; int col, y, x; int ind_type; GD_TLS_VARS; if (ARG_COUNT(ht) != 4 || getParameters(ht, 4, &imarg, &xarg, &yarg, &colarg) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(imarg); convert_to_long(xarg); convert_to_long(yarg); convert_to_long(colarg); col = colarg->value.lval; y = yarg->value.lval; x = yarg->value.lval; /* ^ * In this function x and y are always == to what the user * entered for yarg (as you can see) * * It should be: * x = xarg->value.lval; *********************************************************/ im = php3_list_find(imarg->value.lval, &ind_type); if(!im || ind_type != GD_GLOBAL(le_gd)) { php3_error(E_WARNING, "Unable to find image pointer"); RETURN_FALSE; } gdImageSetPixel(im,x,y,col); RETURN_TRUE; }