1
0
Fork 0

Protection against overflowing the realsound buffer

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@315
This commit is contained in:
Sjoerd van der Berg 2002-10-15 22:26:57 +00:00
parent fea2b58d8f
commit 4c8ce66c86

View file

@ -56,7 +56,7 @@ void PCSPEAKER_SetCounter(Bitu cntr,Bitu mode) {
case 0:
if (cntr>72) cntr=72;
spkr.realsound=true;
spkr.buffer[spkr.buf_pos++]=(cntr-36)*600;
if (spkr.buf_pos<SPKR_BUF) spkr.buffer[spkr.buf_pos++]=(cntr-36)*600;
break;
case 3:
spkr.freq_add=(Bit32u)(FREQ_MAX/((float)SPKR_RATE/(PIT_TICK_RATE/(float)cntr)));