Don't crash in selection extension

This commit is contained in:
Matthias Neeracher 2008-03-24 22:57:06 +00:00
parent 920e7aa0fd
commit d3df79a27e

View File

@ -88,8 +88,7 @@ static VLSong sPasteboard;
if (fSelEnd > -1) {
firstSection = song->fMeasures[fSelStart].fPropIdx;
lastSection = fSelEnd > fSelStart+1 ?
song->fMeasures[fSelEnd].fPropIdx : firstSection;
lastSection = fSelEnd==fSelStart ? firstSection : song->fMeasures[fSelEnd-1].fPropIdx;
} else {
firstSection = 0;
lastSection = song->fMeasures.back().fPropIdx;