mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 19:51:48 +01:00
fixed potential buffer overflow when using resampling (FM High-Quality mode).
This commit is contained in:
parent
3cef34ffa4
commit
0f1850ec6e
@ -187,12 +187,11 @@ int sound_update(unsigned int cycles)
|
||||
/* resynchronize FM & PSG chips */
|
||||
YM2612Update(Fir_Resampler_buffer(), remain);
|
||||
Fir_Resampler_write(remain << 1);
|
||||
fm_cycles_count = psg_cycles_count;
|
||||
}
|
||||
|
||||
fm_cycles_count = psg_cycles_count;
|
||||
|
||||
#ifdef LOGSOUND
|
||||
error("%d FM samples available\n",Fir_Resampler_written() >> 1);
|
||||
error("%d FM samples available (%d needed)\n",Fir_Resampler_written() >> 1, remain);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -210,7 +209,7 @@ int sound_update(unsigned int cycles)
|
||||
error("%lu FM cycles run \n",fm_cycles_count);
|
||||
#endif
|
||||
|
||||
/* adjust PSG & FM cycle counts */
|
||||
/* adjust PSG & FM cycle counts for next frame */
|
||||
psg_cycles_count -= (cycles << 11);
|
||||
fm_cycles_count -= (cycles << 11);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user