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 4043

Summary: SDL_windowswindow.c incorrect icon height
Product: SDL Reporter: mekhontsev
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.7   
Hardware: x86   
OS: Windows 10   

Description mekhontsev 2018-01-12 08:45:45 UTC
Function: WIN_SetWindowIcon
How to reporduce: try to call the function with icon size 256x256

Following line is incorrect:
icon_len = 40 + icon->h * icon->w * sizeof(Uint32);
and shold be replaced to:
icon_len = 40 + icon->h * 2* icon->w * sizeof(Uint32);
Comment 1 Sam Lantinga 2018-01-15 18:04:51 UTC
Why would you need the size to be 2x? I don't see anywhere that it's writing more than 40 bytes plus w * h * 4 bytes to the allocated data.
Comment 2 Sam Lantinga 2018-01-15 18:36:44 UTC
Ah, I see what's happening. Does this fix it?
https://hg.libsdl.org/SDL/rev/44536468cdd2
Comment 3 mekhontsev 2018-01-16 02:01:27 UTC
(In reply to Sam Lantinga from comment #2)
> Ah, I see what's happening. Does this fix it?
> https://hg.libsdl.org/SDL/rev/44536468cdd2

Yes, thank you!
Comment 4 Sam Lantinga 2018-01-16 05:38:34 UTC
Great, thanks!