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

Fix runtime memory leaks on MSVC #336

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Fix runtime memory leaks on MSVC #336

merged 2 commits into from
Jan 22, 2024

Conversation

Rossmaxx
Copy link
Contributor

@Rossmaxx Rossmaxx commented Nov 6, 2023

Hi from the LMMS team. I'm working on adding LADSPA support to MSVC. Someone had attempted to add ladspa support around a year ago and have upstreamed some changes. They fixed all compile time issues but they left out one runtime issue, ie the limiter crashes on the MSVC build of LMMS.

The fix :
STACKALLOC uses VLAs on other platforms and _alloca() on MSVC, because MSVC doesn't support VLAs. But the problem with using _alloca() inside the loop is that it leads to buffer overflow, so I moved it out of the loop. Looks like a rather harmless change and doesn't seem to cause any issues so far, though further testing is appreciated.

Copy link
Collaborator

@JohannesLorenz JohannesLorenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like mentioned in LMMS#10, this issue occurs 2 more times in the same file. I would recommend to fix it there, too.

@Rossmaxx
Copy link
Contributor Author

Rossmaxx commented Nov 8, 2023

Like mentioned in LMMS#10, this issue occurs 2 more times in the same file. I would recommend to fix it there, too.

Done. Thanks for the catch.

@Rossmaxx Rossmaxx changed the title Fix runtime limiter memory leak on MSVC Fix runtime memory leaks on MSVC Nov 8, 2023
Copy link
Collaborator

@JohannesLorenz JohannesLorenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks OK

@JohannesLorenz
Copy link
Collaborator

Just for info, your PR is appreciated, but before I will merge it, I would like to set up the Windows CI for this repo, so apologies for the waiting time.

@Rossmaxx
Copy link
Contributor Author

No issues. Take your time.

@JohannesLorenz JohannesLorenz added this to the 0.90.4 milestone Dec 3, 2023
@JohannesLorenz
Copy link
Collaborator

Tested and CI passed. Thanks for the submission, I will merge this one.

@JohannesLorenz JohannesLorenz merged commit 04c6ad9 into calf-studio-gear:master Jan 22, 2024
This pull request was closed.
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.

2 participants