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

[BUGFIX] OutOfBounds fix when no lime_vorbis and a bit of refactoring #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NotHyper-474
Copy link

@NotHyper-474 NotHyper-474 commented Feb 2, 2025

Certain songs wouldn't load on HashLink, turns out the while (byteNum < oggRangeMax - oggRangeMin) loop was going out of bounds and causing an error, probably something to do with the fact it was not being converted into an Int? Anyway I made it check for the length of the array which is more reliable

I've also removed the temp numBytes variable as it didn't make much sense to me (reusing it for efficiency perhaps?) and replaced the while loops with for ones, Haxe optimizes them as while loops behind the scenes anyway.
And also just replaced input.b.length with just input.length since it didn't make any difference.

@NotHyper-474
Copy link
Author

Apparently it goes out of bounds in all targets but for some reason Lime only does bound checking in HashLink. Even so, I'm confused why it doesn't throw an error in all of them.

@NotHyper-474 NotHyper-474 force-pushed the bugfix/hashlink-error branch 2 times, most recently from d781ea4 to 2d348a4 Compare February 20, 2025 14:15
@NotHyper-474 NotHyper-474 changed the title [BUGFIX] HashLink fix and a bit of refactoring [BUGFIX] OutOfBounds fix for no lime_vorbis and a bit of refactoring Feb 20, 2025
@NotHyper-474 NotHyper-474 changed the title [BUGFIX] OutOfBounds fix for no lime_vorbis and a bit of refactoring [BUGFIX] OutOfBounds fix when no lime_vorbis and a bit of refactoring Feb 20, 2025
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

Successfully merging this pull request may close these issues.

1 participant