Skip to content

Commit

Permalink
gme: fix playback of GYM files loaded from memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitamin-caig committed Nov 20, 2024
1 parent 849a5e4 commit 02e8cc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/gme/gme/Gym_Emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void Gym_Emu::parse_frame()
loop_begin = pos; // find loop on first time through sequence

int cmd;
while ( (cmd = *pos++) != 0 )
while ( pos < data_end && (cmd = *pos++) != 0 )
{
int data = *pos++;
if ( cmd == 1 )
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/gme/gme/Music_Emu.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ inline void Music_Emu::remute_voices() { mute_voices( mute_mask_ );
inline void Music_Emu::ignore_silence( bool b ) { ignore_silence_ = b; }
inline blargg_err_t Music_Emu::start_track_( int track )
{
if ( type()->track_count == 1 )
if ( type()->track_count == 1 && track > 0)
return load_mem_( track_pos( track ), track_size( track ) );
return 0;
}
Expand Down

0 comments on commit 02e8cc1

Please sign in to comment.