3DS: Fix crash if CSND is not available
Jeffrey Pfau jeffrey@endrift.com
Sun, 30 Aug 2015 22:10:12 -0700
1 files changed,
4 insertions(+),
2 deletions(-)
jump to
M
src/platform/3ds/main.c
→
src/platform/3ds/main.c
@@ -77,8 +77,10 @@ #if RESAMPLE_LIBRARY == RESAMPLE_BLIP_BUF
blip_set_rates(runner->context.gba->audio.left, GBA_ARM7TDMI_FREQUENCY, 0x8000); blip_set_rates(runner->context.gba->audio.right, GBA_ARM7TDMI_FREQUENCY, 0x8000); #endif - memset(audioLeft, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); - memset(audioRight, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); + if (hasSound) { + memset(audioLeft, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); + memset(audioRight, 0, AUDIO_SAMPLES * 2 * sizeof(int16_t)); + } } static void _gameUnloaded(struct GBAGUIRunner* runner) {