From 29f60c7e2cd5eddbf056c55f413a1fe2ebdd3ce3 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 19 Oct 2013 22:34:33 +0200 Subject: gme: fixed crash and valgrind error --- plugins/gme/game-music-emu-0.6pre/gme/Ay_Core.cpp | 1 + plugins/gme/game-music-emu-0.6pre/gme/Ay_Emu.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'plugins/gme') diff --git a/plugins/gme/game-music-emu-0.6pre/gme/Ay_Core.cpp b/plugins/gme/game-music-emu-0.6pre/gme/Ay_Core.cpp index 4c56f56a..4e0609ee 100644 --- a/plugins/gme/game-music-emu-0.6pre/gme/Ay_Core.cpp +++ b/plugins/gme/game-music-emu-0.6pre/gme/Ay_Core.cpp @@ -23,6 +23,7 @@ inline void Ay_Core::disable_beeper() Ay_Core::Ay_Core() { + cpc_mode = false; beeper_output = NULL; disable_beeper(); } diff --git a/plugins/gme/game-music-emu-0.6pre/gme/Ay_Emu.cpp b/plugins/gme/game-music-emu-0.6pre/gme/Ay_Emu.cpp index fafbc4ce..3266c305 100644 --- a/plugins/gme/game-music-emu-0.6pre/gme/Ay_Emu.cpp +++ b/plugins/gme/game-music-emu-0.6pre/gme/Ay_Emu.cpp @@ -222,7 +222,11 @@ blargg_err_t Ay_Emu::start_track_( int track ) len = core.mem_size - addr; } check( len ); + printf ("blocks: %d\n", blocks); byte const* in = get_data( file, blocks, 0 ); blocks += 2; + if (!in) { + break; + } if ( len > (unsigned) (file.end - in) ) { set_warning( "File data missing" ); -- cgit v1.2.3