free-audio / clap-plugins

MIT License
61 stars 9 forks source link

Fix out of bounds access in AudioBuffer fromClap/toClap #9

Closed nidefawl closed 1 year ago

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

abique commented 1 year ago

Thank you. I'll merge your change and then perform some adjustments. :+1:

abique commented 1 year ago

FYI, fromClap() and toClap() requires that the channel count is the same on both side. In case you want to partially copy channels I've added a variant for that which takes an additional src_channel and dst_channel.

abique commented 1 year ago

By the way what was your test case to trigger out of bounds access?

nidefawl commented 1 year ago

By the way what was your test case to trigger out of bounds access?

I am writing my own Host/DAW. I built the plugins and just loaded a instance of Synth and played some notes, ending up with random crashes

abique commented 1 year ago

By the way what was your test case to trigger out of bounds access?

I am writing my own Host/DAW. I built the plugins and just loaded a instance of Synth and played some notes, ending up with random crashes

Did you ASAN it? If that happens the bug is unlikey in audio buffer but in its usage or the data passed around. If you have a backtrace that'd be interesting :+1:

nidefawl commented 1 year ago

By the way what was your test case to trigger out of bounds access?

I am writing my own Host/DAW. I built the plugins and just loaded a instance of Synth and played some notes, ending up with random crashes

Did you ASAN it? If that happens the bug is unlikey in audio buffer but in its usage or the data passed around. If you have a backtrace that'd be interesting +1

I did not run sanitizers on it