Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a buffer overflow issue by working around a bug in Core Audio whe…
…re an unit is requested more bytes of audio than the maximum. inp->pullInput ended up writing outside the bounds of the input buffer because CoreAudio requested 528 frames instead of 512... Go figure. This was observed in macOS 10.14.6 build 18G6020. Obviously this could cause crashes, even though in practice they seem rare (one of such crashes may have been posted in error in a comment to issue #4165). All cores which require an audio format conversion are affected (one of them is Gambatte). The fix is more range checking. I also increased the effective input buffer size, to avoid giving CoreAudio less bytes than it requests -- at least in the case I have seen.
- Loading branch information