OSDN Git Service

fix division by zero
authorShohei Urabe <root@mput.dip.jp>
Sun, 17 Oct 2004 22:48:29 +0000 (22:48 +0000)
committerShohei Urabe <root@mput.dip.jp>
Sun, 17 Oct 2004 22:48:29 +0000 (22:48 +0000)
ChangeLog
libunimod/mlutil.c
timidity/mod2midi.c

index 5d2e893..f5539ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
+2004-10-18  Eric A. Welsh <ewelsh@ccb.wustl.edu>
+
+       * libunimod/mlutil.c (getAmigaPeriod): Avoid division by zero
+       * timidity/mod2midi.c: Change all VERB_NORMAL and VERB_VERBOSE
+         messages to VERB_NOISY.
+
 2004-10-17  URABE Shyouhei  <shyouhei@ice.uec.ac.jp>
 
-       * libunimod/mloader.c (SL_LoadSamples):
-         too many arguments to function `FreeSampleList'
+       * libunimod/mloader.c (SL_LoadSamples): too many arguments to
+         function `FreeSampleList'
        * timidity/common.c, timidiyt/timidiyt.c: avoid confliction of
          time.h and sys/time.h
        * timidity/aq.c: fix wrong prototype (int -> void)
index 3fc944d..ea667ce 100644 (file)
@@ -321,6 +321,7 @@ ULONG getAmigaPeriod (UBYTE flags, ULONG period)
   if (flags & UF_LINEAR)
     {
       period = lintab[period % 768] >> (period / 768);
+      if (period < 1) period = 1;
       period = (8363L * 1712L) / period;
     }
 
index 72c0293..dd534d7 100644 (file)
@@ -195,7 +195,7 @@ period2note (int period, int *finetune)
 
   if (period < 14 || period > 13696)
   {
-    ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "BAD period %d\n", period);
+    ctl->cmsg(CMSG_WARNING, VERB_NOISY, "BAD period %d\n", period);
     return -1;
   }
 
@@ -278,7 +278,7 @@ Voice_SetPeriod (UBYTE v, ULONG period)
 
       if (new_noteon < 0)
         {
-         ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
+         ctl->cmsg(CMSG_WARNING, VERB_NOISY,
                          "Strange period %d",
                          ModV[v].period);
          return;
@@ -332,7 +332,7 @@ Voice_Play (UBYTE v, SAMPLE * s, ULONG start)
   new_noteon = period2note (ModV[v].period, &bend);
   bend = WHEEL_VALUE(bend);
   if (new_noteon < 0) {
-    ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
+    ctl->cmsg(CMSG_WARNING, VERB_NOISY,
                          "Strange period %d",
                          ModV[v].period);
     return;