mirror of
https://github.com/libretro/FBNeo.git
synced 2024-11-27 11:00:27 +00:00
sunA 8-bit driver crash prevention
This commit is contained in:
parent
4692fde18f
commit
742750e164
@ -468,6 +468,13 @@ static void sample_render(INT16 *buffer, INT32 nLen)
|
||||
{
|
||||
if (sample_start < 0) return; // stopped
|
||||
|
||||
if (sample_start + (sample_offset >> 16) >= 0x20000 ) {
|
||||
bprintf(0, _T("Bad sample start!\n"));
|
||||
sample_start = -1; // stop
|
||||
sample_offset = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
INT32 step = (8000 << 16) / nBurnSoundRate; // 8khz
|
||||
INT32 pos = 0;
|
||||
INT16 *rom = DrvSamplesExp + sample_start;
|
||||
@ -2400,12 +2407,14 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
|
||||
DACScan(nAction, pnMin);
|
||||
}
|
||||
|
||||
ZetOpen(1);
|
||||
if (strstr(BurnDrvGetTextA(DRV_NAME), "ranger")) {
|
||||
BurnYM2203Scan(nAction, pnMin);
|
||||
} else {
|
||||
AY8910Scan(nAction, pnMin);
|
||||
BurnYM3812Scan(nAction, pnMin);
|
||||
}
|
||||
ZetClose();
|
||||
|
||||
// Scan critical driver variables
|
||||
SCAN_VAR(m_gfxbank);
|
||||
|
Loading…
Reference in New Issue
Block a user