GME: Fix music playback with no fade from crashing

Only crashed with division by zero error on Intel, not on Apple Silicon.
Funny that. Sending the fix upstream, too.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-01-29 16:26:28 -08:00
parent c5f9ffe87c
commit 326e9d5970
1 changed files with 6 additions and 0 deletions

View File

@ -311,6 +311,12 @@ static int int_log( blargg_long x, int step, int unit )
void Music_Emu::handle_fade( long out_count, sample_t* out )
{
if (!fade_step)
{
track_ended_ = emu_track_ended_ = true;
return;
}
for ( int i = 0; i < out_count; i += fade_block_size )
{
int const shift = 14;