prevent out of bounds access for microphone data
This commit is contained in:
parent
0ea0af3abf
commit
c01b2bf7a0
|
@ -330,7 +330,11 @@ void EmuInstance::micProcess()
|
||||||
micBufferReadPos += len;
|
micBufferReadPos += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < kFrameLen)
|
if (len == 0)
|
||||||
|
{
|
||||||
|
memset(tmp, 0, sizeof(tmp));
|
||||||
|
}
|
||||||
|
else if (len < kFrameLen)
|
||||||
{
|
{
|
||||||
for (int i = len; i < kFrameLen; i++)
|
for (int i = len; i < kFrameLen; i++)
|
||||||
tmp[i] = tmp[len-1];
|
tmp[i] = tmp[len-1];
|
||||||
|
|
Loading…
Reference in New Issue