Don't overflow buffers if bsnes goes bonkers
The test state I got by corrupting savestate still crashes however.
This commit is contained in:
parent
80867950f3
commit
1056f4b4b2
1 changed files with 2 additions and 0 deletions
|
@ -762,6 +762,8 @@ namespace
|
|||
{
|
||||
uint16_t _l = l_sample;
|
||||
uint16_t _r = r_sample;
|
||||
//Don't overflow buffers if bsnes goes bonkers.
|
||||
if(soundbuf_fill >= sizeof(soundbuf) / sizeof(soundbuf[0])) return;
|
||||
soundbuf[soundbuf_fill++] = l_sample;
|
||||
soundbuf[soundbuf_fill++] = r_sample;
|
||||
//The SMP emits a sample every 768 ticks of its clock. Use this in order to keep track of
|
||||
|
|
Loading…
Add table
Reference in a new issue