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

View sample file details failure on FreeBSD #107

Open
kwhite-uottawa opened this issue Sep 3, 2024 · 3 comments
Open

View sample file details failure on FreeBSD #107

kwhite-uottawa opened this issue Sep 3, 2024 · 3 comments

Comments

@kwhite-uottawa
Copy link

I get a "Not a RIFF file or a wavpack file." when using the View sample file details menu when running a GoOdf executable built on FreeBSD. As far as I can tell, this is due to char fourCBuffer[4] in WAVfileParser.cpp not necessarily being null terminated when being compared with IsSameAs().

The attached patch fixes the issue for me.
WAVfileParser.txt

@larspalo
Copy link
Collaborator

larspalo commented Sep 4, 2024

Thanks for reporting. I dug a little in this issue and it indeed seems to be an issue also for the windows build. However, just using:

char fourCBuffer[5] = {};

in all declarations seems to be enough to fix it as it's then implicitly zeroed which means that there will always be a zero (null) at the end after four chars are read into it. Could you please test this patch WAVfileParserChange.zip on FreeBSD and report if that works.

@kwhite-uottawa
Copy link
Author

Tested successfully. Yes, your patch also fixes the issue on FreeBSD.

@larspalo
Copy link
Collaborator

larspalo commented Sep 5, 2024

This issue should have been fixed with commit 7505610 and, even if is not yet included in any release, intermediate builds can be found at https://github.com/GrandOrgue/GoOdf/actions/runs/10716356672 for those who doesn't build from source.

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

No branches or pull requests

2 participants