From e6429cc8a255fc9ee63cb0463b6fae8015b8038f Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 30 Aug 2015 22:10:12 -0700 Subject: [PATCH] 3DS: Fix crash if CSND is not available --- src/platform/3ds/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform/3ds/main.c b/src/platform/3ds/main.c index 855bf6615..f81bae9f2 100644 --- a/src/platform/3ds/main.c +++ b/src/platform/3ds/main.c @@ -77,8 +77,10 @@ static void _gameLoaded(struct GBAGUIRunner* runner) { 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) {