From 83178a1dfc39f03b9f6834535f378cfa6afd80dc Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 23 Jul 2020 09:44:20 +1000 Subject: [PATCH] Fix a buffer overflow in the mixer. --- research/ma_mixing.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/research/ma_mixing.h b/research/ma_mixing.h index 390a7dbe..0a4cdf97 100644 --- a/research/ma_mixing.h +++ b/research/ma_mixing.h @@ -2369,6 +2369,11 @@ MA_API ma_result ma_mixer_begin(ma_mixer* pMixer, ma_mixer* pParentMixer, ma_uin } } else { 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. */