don't crash on bad timing
authornotaz <notasas@gmail.com>
Wed, 3 Jul 2013 18:13:11 +0000 (21:13 +0300)
committernotaz <notasas@gmail.com>
Wed, 3 Jul 2013 18:13:11 +0000 (21:13 +0300)
pico/sound/sound.c

index f3cd221..1f23e1a 100644 (file)
@@ -181,6 +181,9 @@ PICO_INTERNAL void PsndDoDAC(int line_to)
   int dout = ym2612.dacout;\r
   int line_from = PsndDacLine;\r
 \r
+  if (line_to >= 312)\r
+    line_to = 311;\r
+\r
   PsndDacLine = line_to + 1;\r
 \r
   pos =dac_info[line_from]>>4;\r