Skip to content

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

@benstevens48

Description

@benstevens48

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions