Jump to content
  • Advertisement
Sign in to follow this  
bori

SDL_CreateRGBSurface - SIGSEGV [SOLVED]

This topic is 3887 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. My app just started SIGSEGVing (trying to access denied memory). I debugged it a bit and found the place of crash.

GLuint AcImageLoader::CreateTexture(SDL_Surface *surface) {
    
   GLuint texture = 0;
   Uint32 saved_flags;
   Uint8  saved_alpha;
   
   
   SDL_Surface *tmp_img;
   
   tmp_img = SDL_CreateRGBSurface(SDL_SWSURFACE, surface->w, surface->h, 32,
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
   0x000000FF,
   0x0000FF00,
   0x00FF0000,
   0xFF000000
#else
   0xFF000000,
   0x00FF0000,
   0x0000FF00,
   0x000000FF
#endif
   );

...

This function is given a surface with pixmap (got from SDL IMG_Load()) and it should convert it to RGBA and swap its rows (further in code, I didn't posted it). However calling SDL_CreateRGBSurface(...) invokes SIGSEGV. Weird thing is that it worked fine and I haven't changed anything in this function. I haven't a clue. Can you help me? Thanks in advance, bori [Edited by - bori on January 27, 2008 4:13:28 PM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by rip-off
Is "surface" a valid pointer?


Well, that's the problem. I went a bit further in debugging and found out that my version of SDL_image can't handle with JPEG.

Thank you!

Share this post


Link to post
Share on other sites
Quote:
Original post by bori
Quote:
Original post by rip-off
Is "surface" a valid pointer?


Well, that's the problem. I went a bit further in debugging and found out that my version of SDL_image can't handle with JPEG.

Thank you!


If you download the SDL_Image DLL, you can copy all the other DLLs in the folder too, to support them. Have you jpeg.dll in the same folder as SDL_Image.dll?

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-off
If you download the SDL_Image DLL, you can copy all the other DLLs in the folder too, to support them. Have you jpeg.dll in the same folder as SDL_Image.dll?


Well, I'm compiling SDL from source, because I'm not using Windows, but thanks for reply. ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!