From 9b5713af95da3f72cb659d4d8017559aca593a31 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 3 Jul 2013 21:13:11 +0300 Subject: [PATCH] don't crash on bad timing --- pico/sound/sound.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pico/sound/sound.c b/pico/sound/sound.c index f3cd221..1f23e1a 100644 --- a/pico/sound/sound.c +++ b/pico/sound/sound.c @@ -181,6 +181,9 @@ PICO_INTERNAL void PsndDoDAC(int line_to) int dout = ym2612.dacout; int line_from = PsndDacLine; + if (line_to >= 312) + line_to = 311; + PsndDacLine = line_to + 1; pos =dac_info[line_from]>>4; -- 2.39.2