mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 10:31:16 +00:00
MxSoundManager: use buffer size and don't rely on buffer capacity
This fixes a detect_container_overflow address sanitizer error.
This commit is contained in:
parent
6f192a3b1c
commit
f78d3ffad8
@ -148,7 +148,10 @@ void MxSoundManager::AudioStreamCallback(
|
||||
)
|
||||
{
|
||||
static vector<MxU8> g_buffer;
|
||||
g_buffer.reserve(p_additionalAmount);
|
||||
if (p_additionalAmount > g_buffer.size()) {
|
||||
// We resize and don't reserve memory to avoid an AddressSanitizerContainerOverflow asan error
|
||||
g_buffer.resize(p_additionalAmount);
|
||||
}
|
||||
|
||||
MxSoundManager* manager = (MxSoundManager*) p_userdata;
|
||||
ma_uint32 bytesPerFrame = ma_get_bytes_per_frame(ma_format_f32, ma_engine_get_channels(manager->m_engine));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user