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 - segfault in SDL_ConvertSurface with surface loaded by SDL_image 1.2.10/SDL 1.3
Summary: segfault in SDL_ConvertSurface with surface loaded by SDL_image 1.2.10/SDL 1.3
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 1.2.10
Hardware: x86_64 Mac OS X 10.6
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-20 09:29 UTC by Martin Gerhardy
Modified: 2012-11-06 20:19 UTC (History)
0 users

See Also:


Attachments
the backtrace (11.27 KB, text/plain)
2011-11-20 09:29 UTC, Martin Gerhardy
Details

Note You need to log in before you can comment on or make changes to this bug.
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!