mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
SrmRideFile: handle EOF while reading chunks
code was blindly trusting datacnt... and kept reading past EOF. That's bad as datacnt occasionally isn't matching the available data (overflow, corruption, ...)
This commit is contained in:
@@ -285,6 +285,11 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if( in.status() != QDataStream::Ok ){
|
||||
errorStrings << QString("premature end of file" );
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
result->setStartTime(blockhdrs[blknum].dt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user