From 0fab9b901a21622f2a866ff477599e65fb565df0 Mon Sep 17 00:00:00 2001 From: peterbrant14 Date: Tue, 28 Apr 2020 17:45:21 +0100 Subject: [PATCH] Fix indexing bugs in the original TTS code (#3423) --- src/FileIO/TTSReader.cpp | 2 +- src/Train/ErgFile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FileIO/TTSReader.cpp b/src/FileIO/TTSReader.cpp index 71e21a750..ae32c997f 100644 --- a/src/FileIO/TTSReader.cpp +++ b/src/FileIO/TTSReader.cpp @@ -836,7 +836,7 @@ bool TTSReader::loadHeaders() { if (basis != Slope && slopeCount) { while (si.WantsInput(p.getDistanceFromStart())) { - if (slopeIdx >= frameMapCount) { + if (slopeIdx >= slopeCount) { si.NotifyInputComplete(); break; } diff --git a/src/Train/ErgFile.cpp b/src/Train/ErgFile.cpp index 958c36b0e..71b827ea4 100644 --- a/src/Train/ErgFile.cpp +++ b/src/Train/ErgFile.cpp @@ -888,7 +888,7 @@ void ErgFile::parseTTS() alt = ttsPoints[0].getElevation(); } - for (int i = 0; i <= pointCount; i++) { // first data point is actually the last... + for (int i = 0; i < pointCount; i++) { // first data point is actually the last... ErgFilePoint add; prevPoint = point;