We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reported in version: HG 2.0 Reported for operating system, platform: Windows (XP), x86
On 2011-05-24 07:42:21 +0000, Andrey Budko wrote:
This code crashes application: void I_SetWindowIcon(void) { SDL_Surface *surface; Uint8 *mask; int i; // Generate the mask mask = malloc(icon_w * icon_h / 8); memset(mask, 0, icon_w * icon_h / 8); for (i=0; i<icon_w * icon_h; ++i) { if (icon_data[i * 3] != 0x00 || icon_data[i * 3 + 1] != 0x00 || icon_data[i * 3 + 2] != 0x00) { mask[i / 8] |= 1 << (7 - i % 8); } } surface = SDL_CreateRGBSurfaceFrom(icon_data, icon_w, icon_h, 24, icon_w * 3, 0xff << 0, 0xff << 8, 0xff << 16, 0); SDL_WM_SetIcon(surface, mask); SDL_FreeSurface(surface); free(mask); } main() { screen = SDL_SetVideoMode(REAL_SCREENWIDTH, REAL_SCREENHEIGHT, V_GetNumPixelBits(), init_flags); I_SetWindowIcon(); SDL_FreeSurface(screen); screen = NULL; screen = SDL_SetVideoMode(REAL_SCREENWIDTH, REAL_SCREENHEIGHT, V_GetNumPixelBits(), init_flags); } Without I_SetWindowIcon() it works fine. SDL 1.2.14 works fine here.
This code crashes application:
void I_SetWindowIcon(void) { SDL_Surface *surface; Uint8 *mask; int i;
// Generate the mask mask = malloc(icon_w * icon_h / 8); memset(mask, 0, icon_w * icon_h / 8);
for (i=0; i<icon_w * icon_h; ++i) { if (icon_data[i * 3] != 0x00 || icon_data[i * 3 + 1] != 0x00 || icon_data[i * 3 + 2] != 0x00) { mask[i / 8] |= 1 << (7 - i % 8); } }
surface = SDL_CreateRGBSurfaceFrom(icon_data, icon_w, icon_h, 24, icon_w * 3, 0xff << 0, 0xff << 8, 0xff << 16, 0);
SDL_WM_SetIcon(surface, mask); SDL_FreeSurface(surface); free(mask); }
main() { screen = SDL_SetVideoMode(REAL_SCREENWIDTH, REAL_SCREENHEIGHT, V_GetNumPixelBits(), init_flags);
I_SetWindowIcon();
SDL_FreeSurface(screen);
screen = NULL; screen = SDL_SetVideoMode(REAL_SCREENWIDTH, REAL_SCREENHEIGHT, V_GetNumPixelBits(), init_flags); }
Without I_SetWindowIcon() it works fine.
SDL 1.2.14 works fine here.
On 2011-05-24 07:44:58 +0000, Andrey Budko wrote:
It does not crash if I do not free icon surface SDL_WM_SetIcon(surface, mask); //SDL_FreeSurface(surface);
It does not crash if I do not free icon surface
SDL_WM_SetIcon(surface, mask); //SDL_FreeSurface(surface);
On 2013-05-21 02:41:40 +0000, Sam Lantinga wrote:
Hey Ryan, something for you to check with your SDL 1.2 wrapper.
On 2015-02-18 03:29:31 +0000, Ryan C. Gordon wrote:
(In reply to Sam Lantinga from comment # 2) Hey Ryan, something for you to check with your SDL 1.2 wrapper. Noted. :) --ryan.
(In reply to Sam Lantinga from comment # 2)
Noted. :)
--ryan.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This bug report was migrated from our old Bugzilla tracker.
Reported in version: HG 2.0
Reported for operating system, platform: Windows (XP), x86
Comments on the original bug report:
On 2011-05-24 07:42:21 +0000, Andrey Budko wrote:
On 2011-05-24 07:44:58 +0000, Andrey Budko wrote:
On 2013-05-21 02:41:40 +0000, Sam Lantinga wrote:
On 2015-02-18 03:29:31 +0000, Ryan C. Gordon wrote:
The text was updated successfully, but these errors were encountered: