diff --git a/VERSION b/VERSION index 42f91b4..97d67e1 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -2021 May 09 2021 +2021 May 10 2021 diff --git a/doc/CHANGES b/doc/CHANGES index ed503ab..a79f7d6 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -14172,3 +14172,35 @@ to 1 when parseline() encounters "%%beginps" and is reset to 0 when %%endps" is encountered. If ignore_line is 1, the rest of the code in parseline() is ignored when abc2midi is running. + +May 10 2020 + +abc2midi: the following file causes a core dump. + +X:1 +T:Autumn Ale +C:Chance Thomas, Stephen DiGregorio, Geoff Scott and/or Brad Spear +R:Jig +S:The Lord of the Rings Online Soundtrack +O:Turbine's Middle Earth +Z:Northman +N:This is not intended for percussion instruments. +Q:333 +M:6/8 +L:1/8 +K:D +AGA BA/3B/3A/3G | FE/3F/3E/3D EFG | + +abc2midi notpowerof2.abc +4.53 May 09 2021 abc2midi +Error in line-char 13-5 : 3 b is not a power of 2 +Error in line-char 13-8 : 3 b is not a power of 2 +Floating point exception (core dumped) + +Analysis: the crash occurs in the function reduce (0) +which cannot handle a division by zero. The function +check_power_of_two(3) in parseabc.c returns 0 when the +argument is not a power of 2. Fix: changed the return +to -1. The program does not crash but the midi file +is not created correctly. + diff --git a/doc/readme.txt b/doc/readme.txt index 52e34ce..6059e8b 100644 --- a/doc/readme.txt +++ b/doc/readme.txt @@ -1,7 +1,7 @@ abcMIDI : abc <-> MIDI conversion utilities midi2abc version 3.47 November 01 2020 -abc2midi version 4.53 May 08 2021 +abc2midi version 4.54 May 10 2021 abc2abc version 2.13 May 08 2021 yaps version 1.86 December 10 2020 abcmatch version 1.78 March 27 2021 diff --git a/parseabc.c b/parseabc.c index 942c5ab..395705a 100644 --- a/parseabc.c +++ b/parseabc.c @@ -420,7 +420,7 @@ int check_power_of_two(int denom) if (t % 2 != 0) { snprintf(error_message, 80, "%d b is not a power of 2", denom); event_error (error_message); - return 0; + return -1; } else { t = t / 2; } diff --git a/store.c b/store.c index e40922b..d197fea 100644 --- a/store.c +++ b/store.c @@ -186,7 +186,7 @@ int main() */ -#define VERSION "4.53 May 09 2021 abc2midi" +#define VERSION "4.54 May 10 2021 abc2midi" /* enables reading V: indication in header */ #define XTEN1 1