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 5202

Summary: Crash with UWP MessageBox
Product: SDL Reporter: moemod <824395314>
Component: videoAssignee: David Ludwig <dll>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: icculus
Version: 2.0.12Keywords: target-2.0.14
Hardware: x86_64   
OS: Windows 10   

Description moemod 2020-06-19 12:05:16 UTC
I have a UWP program built with SDL2. After I update to a newer version, it crashes after clicking a button on messagebox. 

A Platform::InvalidCastException was thrown at https://github.com/spurious/SDL-mirror/commit/1758af58f5edc6872b441c844106f76129cae252#diff-8f71cf6c43858565f3bcf4987c98e3c7R107

Built with MSVC 19.26 and Windows SDK 10.0.18362, x64.

After I roll back this commit, everything works fine. Is this change safe?
Comment 1 Ryan C. Gordon 2020-07-16 17:27:18 UTC
I believe (but have not tested) that this is fixed in https://hg.libsdl.org/SDL/rev/8e63abf94443

It looks like we accidentally cast a pointer to an int, which chops off the top half on 64-bit platforms, so we cast it to a size_t instead, now.

--ryan.