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 - SDL_windowswindow.c incorrect icon height
Summary: SDL_windowswindow.c incorrect icon height
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.7
Hardware: x86 Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-12 08:45 UTC by mekhontsev
Modified: 2018-01-16 05:38 UTC (History)
0 users

See Also:


Attachments

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