# HG changeset patch # User Chris Cannam # Date 1336751954 -3600 # Node ID 325cc75df35a0bab3b13c44414fbfda36173a4e5 # Parent 28aafd0c1a5d85406a290570e44dc08d921a64f0 Fix crash on silent input diff -r 28aafd0c1a5d -r 325cc75df35a songparts/SongParts.cpp --- a/songparts/SongParts.cpp Fri May 11 16:30:34 2012 +0100 +++ b/songparts/SongParts.cpp Fri May 11 16:59:14 2012 +0100 @@ -1452,6 +1452,8 @@ { int len = partlengths(iLength); int nUsedBeat = nBeat - len + 1; // number of potential rep beginnings: they can't overlap at the end of the song + + if (nUsedBeat < 1) continue; for (int iBeat = 0; iBeat < nUsedBeat; ++ iBeat) // looping over all columns (arbitrarily chosen columns) { @@ -1649,7 +1651,7 @@ { Part newPart; newPart.n = nBeat; - newPart.indices.push_back(1); + newPart.indices.push_back(0); newPart.letter = 'A'; newPart.value = 1; newPart.level = 1;