www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/21/14:32:48

From: nighthawk DOT NOSPAM AT nuernberg DOT NOUCE DOT netsurf DOT de (Nighthawk)
Newsgroups: comp.os.msdos.djgpp
Subject: Some trouble with Allegro & DJGPP
Date: Fri, 21 Nov 1997 18:50:23 GMT
Organization: Hawk's Nest
Message-ID: <3475d323.781597@news.nuernberg.netsurf.de>
NNTP-Posting-Host: pmx35.nuernberg.netsurf.de
Lines: 35
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019