mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-03 12:28:10 +03:00
Fix potential buffer overrun in mako_ymfm.cpp
This commit is contained in:
@@ -20,6 +20,11 @@ MakoYmfm::MakoYmfm(int rate, std::vector<uint8_t> data) :
|
||||
void MakoYmfm::Process(int16_t* stream, int len) {
|
||||
int16_t* buf = stream;
|
||||
|
||||
if (samples_left > len) {
|
||||
Generate(buf, len);
|
||||
samples_left -= len;
|
||||
return;
|
||||
}
|
||||
if (samples_left > 0) {
|
||||
Generate(buf, samples_left);
|
||||
buf += samples_left * 2;
|
||||
|
||||
Reference in New Issue
Block a user