[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] problem with Surface.set_palette_at



i believe in

static PyObject* surf_set_palette_at(PyObject* self, PyObject* args)

is a problem at line #497 (latest cvs version i believe). i was not able to set color index 0 for an image. i always get an IndexError. looking at set_palette_at, i think the index check is wrong. the SDL documentation does indicate that the starting index = 0, but the check disables 0.

if(index >= pal->ncolors || index <= 0)
{
PyErr_SetString(PyExc_IndexError, "index out of bounds");
return NULL;
}

shouldn't it say

if ((index < 0) || (index > (pal->ncolors -1))

or am i missing something?

kaweh

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org