Mail Archives: djgpp/1997/11/21/14:32:48
Hi there !
I'm currently developing a module for Allegro to support the loading
of GIF Files (yes, I know there is already one, but I need it for
special purposes :) and I ran into some trouble when reading the
palette. The program always crashes there.
Here's the snippet of code that's concerned :
if (GlobalPallete)
for (i = 0; i < ColorMapSize; i++) {
pallete[i]->r = NEXTBYTE;
pallete[i]->g = NEXTBYTE;
pallete[i]->b = NEXTBYTE;
}
I have to say to this :
The function is defined as BITMAP *load_gif(const char* name, PALLETE*
pallete);
The whole gif file is read into memory with a pointer called data_ptr
to it. NEXTBYTE is defined as *data_ptr++. ColorMapSize is 256.
Now, the SIGSEV always occurres when i = 152;
Do you know what's wrong ?
(pallete is allocated by (PALLETE*) malloc(sizeof(PALLETE)); from the
main program.)
I'm almost desperate...so I'd be very glad if someone could help :-)
Thank you in advance !
Matthias - Nighthawk - Tessmann
--
Singnature still under development, no beta release yet.
Please wait...
Remove .NOSPAM and .NOUCE to reply via e-Mail.
- Raw text -