arduano / Kiva

An optimised and modern MIDI player, with the goal of replacing Piano From Above as well as some other common black midi players.
Other
58 stars 13 forks source link

Dropping a MIDI file from a zipped folder causes the application to freeze. #8

Closed MaddyGuthridge closed 4 years ago

MaddyGuthridge commented 4 years ago

System info:

Windows 10 v1909 Intel Core i7 8550U 16 GB RAM

Steps to reproduce:

Expected outcome:

The MIDI loads normally

Actual outcome:

Kiva's window lightens upon moving the file over it, then freezes upon dropping the file, and becomes unresponsive for an indefinite amount of time.

arduano commented 4 years ago

What zipping tool are you using? Can't reproduce with winrar

MaddyGuthridge commented 4 years ago

Not sure... it was a ZIP that was sent to me by some random on my Discord Server. Here's the actual file tho... It loads fine when I extract it.

[Link retracted at the request of the owner.]

Replacement file where the error can also be reproduced:

i started a joke.zip

After you've downloaded the file I'll need to remove it since the author requested that it not be shared publicly.

arduano commented 4 years ago

Same deal

I download, open in winrar, drag the .mid into kiva, kiva loads it as intended

MaddyGuthridge commented 4 years ago

Try opening it in Windows Explorer?

MaddyGuthridge commented 4 years ago

When I use 7Zip I get this error image

arduano commented 4 years ago

I assume this is a 7z problem

when opening a file from a zip, the zip program must save it as a temporary file somewhere else and then supply the temporary path argument later. Because it works in winrar, I assume winrar doesn't correctly save the temporary file before telling the program about it.

The code is really simple here: image I don't see what could go wrong

MaddyGuthridge commented 4 years ago

Ok so I've tried with another MIDI, which I compressed using Windows Explorer (Send To > Compressed (Zipped) Folder). Opening from Explorer yielded the same result as initially mentioned, and opening from 7Zip produces the error message. The error with 7Zip indicates that that may be an issue on 7Zip's end, but for explorer, it looks like your app freezes with no errors.

arduano commented 4 years ago

What version are you on?

MaddyGuthridge commented 4 years ago

1.1.14

arduano commented 4 years ago

Does it freeze up on basically all dragged in midis from explorer? try some well established midi that should definitely work

MaddyGuthridge commented 4 years ago

Works fine for extracted MIDIs. The issue is only present when using MIDIs dragged from inside ZIPs from Explorer.

arduano commented 4 years ago

Oh I see, just reproduced it yeah, give me a sec to figure out the problem

arduano commented 4 years ago

Ok after debugging this, seems like a windows explorer problem When drag and dropping the files in, it doesn't even get recognized as a "file drag and drop", but some other form of drag and drop. It makes sense for that to happen anyway, as giving full access to a file like this would require extracting it into a temporary directory like winrar or 7z do, and explorer doesnt want to do that.

I'll try to add some checks later to prevent it from just freezing up, and actually tell the user that the drop was invalid.

MaddyGuthridge commented 4 years ago

Ok cool