Closed sinshu closed 1 year ago
@sinshu I appreciate you taking the time to file this issue. It means a lot that you care to help! ❤️
Yes it appears I have the same mistake:
mistake:
factory SoundFontParameters.fromReader(BinaryReader reader) {
...
int end = reader.pos + reader.readInt32();
...
}
should be:
factory SoundFontParameters.fromReader(BinaryReader reader) {
...
int end = reader.readInt32();
end += reader.pos;
...
}
I will fix the code.
I see the same mistakes you fixed are here: https://github.com/sinshu/meltysynth/commit/ebc0b9126bc5d193a7851c38b0d13f3cb79952d1
Hi.
I have discovered a potential issue in the C# version. For instance, in the constructor of
SoundFontParameters
, the variableend
was calculated as follows:In this case,
end
would end up being 4 bytes smaller than the desired value. Ideally,end
should be calculated after the completion ofReadInt32()
:There are also several similar pieces of code beyond
SoundFontParameters
. I suspect that there are very few SoundFonts that would cause this to be an issue, but I wanted to report this just in case.