steffest / BassoonTracker

Webbased old-school Amiga music tracker in plain old javascript - Plays and edits Amiga Mod files and FastTracker XM files
http://www.stef.be/bassoontracker/
MIT License
1k stars 61 forks source link

Uncaught RangeError on loading a local file #63

Closed alex40724 closed 3 years ago

alex40724 commented 3 years ago

When dropping a local .mod file (previously exported by the tracker), I get a

Uncaught RangeError: Offset is outside the bounds of the DataView at DataView.getUint32

error (Firefox and Chrome on MacOs 10.15).

Bildschirmfoto 2021-01-03 um 17 06 17

Thanks for the great tool!

alex40724 commented 3 years ago

demo.zip

This is the file. Other files seem to work. I also noticed that the "Browse" button in the local file dialog only appears in the "dev.html" version, not only in the regular "index.html" loading the minified js (current master branch, running on local apache).

steffest commented 3 years ago

Thanks for the ZIP. Indeed, there are some invalid sample lengths in that file causing BassoonTracker to try read beyond the end of the file. Both ProTracker and Fasttracker also don't load it. At least BassoonTracker should display a message in such cases in stead of just failing silently. I'll mark it as bug and fix it soon. Thanks for the report!

alex40724 commented 3 years ago

Thanks for the quick feedback.

Please note that the file has been exported by BassoonTracker itself. So trying to re-load the mod is the end of a longer process. If the invalid lengths are part of the sample files, the best time to show such a message would probably be when the sample is loaded the first time.

steffest commented 3 years ago

I fixed the underlying issue. When switching from XM to MOD, it still was possible to save more than 31 samples in a MOD file, which resulted in a corrupt file. I added some validation and warning dialogs, also for samples that are too long for MOD format and would be truncated on save.

I case you still need it, this is your fixed demosong: demosong1_fixed.zip

alex40724 commented 3 years ago

Thanks for the quick fix and thanks for taking care of the file, too!