mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-10 18:21:14 +00:00
MxSoundManager: use buffer size and don't rely on buffer capacity (#758)
This fixes a detect_container_overflow address sanitizer error.
This commit is contained in:
parent
6f192a3b1c
commit
7742fb0493
@ -148,7 +148,9 @@ void MxSoundManager::AudioStreamCallback(
|
||||
)
|
||||
{
|
||||
static vector<MxU8> g_buffer;
|
||||
g_buffer.reserve(p_additionalAmount);
|
||||
if (p_additionalAmount > g_buffer.size()) {
|
||||
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