We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1334

Summary: segfault in SDL_ConvertSurface with surface loaded by SDL_image 1.2.10/SDL 1.3
Product: SDL_image Reporter: Martin Gerhardy <martin.gerhardy>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 1.2.10   
Hardware: x86_64   
OS: Mac OS X 10.6   
Attachments: the backtrace

Description Martin Gerhardy 2011-11-20 09:29:10 UTC
I'm not sure whether it's a problem in SDL_image or SDL. But loading an image with SDL_image 1.2.10 on an intel mac 64 bit results in a segfault (bt full is attached)

The SDL version that was used was SDL 1.3 from Nov. 15th

------------------snip----------------------------------

	SDL_Surface *surf = IMG_Load(file.getName());

	SDL_PixelFormat format;
	memset(&format, 0, sizeof(format));
	format.BitsPerPixel = 32;
	format.BytesPerPixel = 4;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
	format.Rmask = 0xff000000;
	format.Gmask = 0x00ff0000;
	format.Bmask = 0x0000ff00;
	format.Amask = 0x000000ff;
#else
	format.Rmask = 0x000000ff;
	format.Gmask = 0x0000ff00;
	format.Bmask = 0x00ff0000;
	format.Amask = 0xff000000;
#endif
	format.Rshift = 24;
	format.Gshift = 16;
	format.Bshift = 8;
	format.Ashift = 0;

	// here comes the segfault
	SDL_Surface * converted = SDL_ConvertSurface(surf, &format, 0);

------------------snap----------------------------------
Comment 1 Martin Gerhardy 2011-11-20 09:29:50 UTC
Created attachment 730 [details]
the backtrace

the backtrace
Comment 2 Martin Gerhardy 2012-11-06 11:44:49 UTC
this can be closed - it works with the latest sdl version.
Comment 3 Sam Lantinga 2012-11-06 20:19:50 UTC
Great, thanks!