Fix a buffer overflow in the mixer.

This commit is contained in:
David Reid
2020-07-23 09:44:20 +10:00
parent 5dda38d417
commit 83178a1dfc
+5
View File
@@ -2369,6 +2369,11 @@ MA_API ma_result ma_mixer_begin(ma_mixer* pMixer, ma_mixer* pParentMixer, ma_uin
} }
} else { } else {
frameCountIn = frameCountOut; frameCountIn = frameCountOut;
if (frameCountIn > pMixer->accumulationBufferSizeInFrames) {
frameCountIn = pMixer->accumulationBufferSizeInFrames;
frameCountOut = pMixer->accumulationBufferSizeInFrames;
}
} }
/* If the output frame count cannot match the parent's input frame count we need to fail. */ /* If the output frame count cannot match the parent's input frame count we need to fail. */