Skip to content
New issue

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

DragUI.SetContentFromDataPackage() with StandardDataFormats.Bitmap in data package where bitmap cannot be decoded causes crash on drag over #5158

Open
benstevens48 opened this issue Feb 14, 2025 · 0 comments

Comments

@benstevens48
Copy link

I'm using UWP but the equivalent exists in WindowsAppSDK (needs checking).

If I call DragUI.SetContentFromDataPackage() on drag starting, and I have set the data package contents to a bitmap which isn't valid (probably even can set a valid image of some type but which Windows can't decode), then on DragOver (if drop allowed and accepted) the app will crash. There's no way to catch the error (except perhaps in the unhandled exception handler). I haven't tested it but I imagine this might crash another app if dragging between apps (not actually sure which app will crash in that case). This should not result in a crash. It should simply either show a generic image icon or just the drag cursor or whatever is appropriate, there is no need to crash, and one can't always easily verify that the bitmap data set in the data package is something that can be decoded by Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant