Skip to content

Commit

Permalink
prevent out of bounds access for microphone data
Browse files Browse the repository at this point in the history
  • Loading branch information
RSDuck committed Nov 18, 2024
1 parent 0ea0af3 commit c01b2bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/frontend/qt_sdl/EmuInstanceAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ void EmuInstance::micProcess()
micBufferReadPos += len;
}

if (len < kFrameLen)
if (len == 0)
{
memset(tmp, 0, sizeof(tmp));
}
else if (len < kFrameLen)
{
for (int i = len; i < kFrameLen; i++)
tmp[i] = tmp[len-1];
Expand Down

0 comments on commit c01b2bf

Please sign in to comment.