Archived

This topic is now archived and is closed to further replies.

TeraByte

Fatal signal: Segmentation Fault (SDL Parachute Deployed) HELP ME!

Recommended Posts

I posted this in the For Beginners section, but so far have not got a reply, i will check again later, but im not sure when i can get on the net next, so i would appreciate if someone could help soon... I keep getting this error: Fatal signal: Segmentation Fault (SDL Parachute Deployed) I keep getting it with this code: Data[frame-1].image = SDL_DisplayFormat(temp); Please help! Thanks in advance.

Share this post


Link to post
Share on other sites
Maybe you didn''t get any info because it is imposible to ive an answere for the info you provide. A Segmentation violation can be cause by anything.

When looking at you code it is probably that your index in Data is out of bounds. Do you start counting your frame from zero, because then you have Data[-1].image.... In general you see a forloop going from 0 to N-1, with N the size o the Data array. Then you can use Data(frame).image in your loop (then you also do one substraction less inside your loop ).

Share this post


Link to post
Share on other sites
smilydon''s right !!! We need some more info, but another solution might be to call SDL_CreateSurface on the SDL_Surface in the "Data" array if you forgot to .

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Ced1
smilydon''s right !!! We need some more info, but another solution might be to call SDL_CreateSurface on the SDL_Surface in the "Data" array if you forgot to .


No, SDL_DisplayFormat() copies the surface and returns a pointer to the copy.

It''s more likely a value going out of bounds, or an invalid value in "temp" (have you checked that "temp" is valid?). Also, you can only create surfaces after you have succesfully created the video subsystem (via SDL_Init or SDL_InitSubSystem). Make sure that these calls succeeded too.

Share this post


Link to post
Share on other sites