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 5468

Summary: [KMSDRM] Fix corruption on dynamic cursor changing
Product: SDL Reporter: Manuel Alfayate Corchete <redwindwanderer>
Component: videoAssignee: Manuel Alfayate Corchete <redwindwanderer>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: 2.0.15   
Hardware: All   
OS: Linux   
Attachments: Fix cursor corruption when it's changed dynamically to a different size bitmap

Description Manuel Alfayate Corchete 2021-01-15 21:47:37 UTC
Created attachment 4669 [details]
Fix cursor corruption when it's changed dynamically to a different size bitmap

Hi,

Just noticed that, in FHeroes2 (https://github.com/ihhub/fheroes2), dynamic cursor changing on the map screen causes a small corruption. It's because I was not using the right size for the cursor buffer.

Fix patch attached. Please review. Thanks.
Comment 1 Ozkan Sezer 2021-01-17 16:45:36 UTC
Looks OK to me. Although you can just remove the memset and
simply change the allocation to
	ready_buffer = (uint32_t*)SDL_calloc(1, bufsize);
Comment 2 Sam Lantinga 2021-01-17 18:03:22 UTC
I agree with Ozkan. Go ahead and commit after you make that change.
Comment 3 Manuel Alfayate Corchete 2021-01-17 20:34:56 UTC
Ok! Changes done as requested, and pushed. Thanks for reviewing. Closing this.