Fatal signal: Segmentation Fault (SDL Parachute Deployed) HELP ME!
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.
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 ).
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 ).
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 .
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement