Dodgy code?

Greetings.

In SDL_DIBVideo.c,

int DIB_SetColors(_THIS, int firstcolor, ..., ...)

on line 667,

...

/* Copy palette colors into DIB palette */
for ( i=0; i<palette->ncolors; ++i ) {
	pal[i].rgbRed = colors[i].r;

...

palette->ncolors is being accessed before palette is allocated! In 

facy palette is never allocated in this function as far as i can tell.
Am i missing something or is this a bug?

-dv

palette->ncolors is being accessed before palette is allocated! In
facy palette is never allocated in this function as far as i can tell.

This code has recently been changed. Please have a look at the latest CVS
code to see if the bug is still there

In fact, since the SetColors() code in all drivers has been changed and I
only have tested the X11 code, I hereby urge everyone to compile, test or
at least have a look at the sources. The new testpalette proglet may be of
some use.

palette->ncolors is being accessed before palette is allocated! In
facy palette is never allocated in this function as far as i can tell.

This code has recently been changed. Please have a look at the latest CVS
code to see if the bug is still there

This was fixed last night, and I’ll incorporate the code as soon as I can
get !@#$% CodeWarrior to bend to my will. :slight_smile:

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

This was fixed last night, and I’ll incorporate the code as soon as I can
get !@#$% CodeWarrior to bend to my will. :slight_smile:

If you need help with CodeWarrior, just ask. It’s quite a change from
makefiles, and it’s not worth you wasting your time banging away at
things that other people have already wasted time working out. Of
course, that takes away the satisfaction you get from finally solving the
puzzle yourself… :slight_smile:

-Roy