[GH-ISSUE #21] Uninitialized memory on lastSample[L|R] in Loud #16

Closed
opened 2026-05-05 22:01:47 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @baconpaul on GitHub (Nov 9, 2020).
Original GitHub issue: https://github.com/airwindows/airwindows/issues/21

Hi Chris!

Wrapping up the Airwindows surge integration and one of our users noticed that sometimes Loud would come up and clip right away. I investigated.

8aa7017bfd/plugins/MacVST/Loud/source/Loud.cpp (L20)

Turns out Loud doesn't initialize lastSampleL or lastSampleR in its constructor, so if you create a Loud you can get - well - anything. In our situation where we are creating AWFX inside surge, we can often sit on memory that has values and that blows us up.

I fixed it by adding a '=0' in the class but I guess you want to add an init in the .cpp there and in the other forks perhaps?

Here's the surge issue which links to the fix we put in our copy of the FX.

https://github.com/surge-synthesizer/surge/issues/2620

Thanks so much! Hope this helps

Originally created by @baconpaul on GitHub (Nov 9, 2020). Original GitHub issue: https://github.com/airwindows/airwindows/issues/21 Hi Chris! Wrapping up the Airwindows surge integration and one of our users noticed that sometimes Loud would come up and clip right away. I investigated. https://github.com/airwindows/airwindows/blob/8aa7017bfd41a2c532dca3c5ae1477ce3e3042fe/plugins/MacVST/Loud/source/Loud.cpp#L20 Turns out Loud doesn't initialize `lastSampleL` or `lastSampleR` in its constructor, so if you create a Loud you can get - well - anything. In our situation where we are creating AWFX inside surge, we can often sit on memory that has values and that blows us up. I fixed it by adding a '=0' in the class but I guess you want to add an init in the .cpp there and in the other forks perhaps? Here's the surge issue which links to the fix we put in our copy of the FX. https://github.com/surge-synthesizer/surge/issues/2620 Thanks so much! Hope this helps
Author
Owner

@airwindows commented on GitHub (Nov 9, 2020):

Thank you! That got past me. I can't fix it tonight but I've just fixed a bug in ClipOnly (where it used a float even for use with double precision VST) and you've found the sort of thing where I will absolutely zip off and fix it and update it in place. I can probably get it tomorrow :)

<!-- gh-comment-id:723726864 --> @airwindows commented on GitHub (Nov 9, 2020): Thank you! That got past me. I can't fix it tonight but I've just fixed a bug in ClipOnly (where it used a float even for use with double precision VST) and you've found the sort of thing where I will absolutely zip off and fix it and update it in place. I can probably get it tomorrow :)
Author
Owner

@baconpaul commented on GitHub (Nov 9, 2020):

Cool! I already have it fixed in our integration in surge so no rush from here, but glad it helps!

We plan to do our prod release in January by the way and air windows integration is one of our three or four big new features. Thanks for making such uniform useful software!

<!-- gh-comment-id:723732064 --> @baconpaul commented on GitHub (Nov 9, 2020): Cool! I already have it fixed in our integration in surge so no rush from here, but glad it helps! We plan to do our prod release in January by the way and air windows integration is one of our three or four big new features. Thanks for making such uniform useful software!
Author
Owner

@airwindows commented on GitHub (Nov 9, 2020):

Fixed, and pushed to GitHub. Thank you! If you run across anything else like that, let me know: I can often turn around this type of fix pretty quickly :)

<!-- gh-comment-id:724063910 --> @airwindows commented on GitHub (Nov 9, 2020): Fixed, and pushed to GitHub. Thank you! If you run across anything else like that, let me know: I can often turn around this type of fix pretty quickly :)
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/airwindows#16
No description provided.