1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-03-23 06:48:27 +01:00

Fixed error handling

This commit is contained in:
Martin Tůma 2025-03-21 05:56:17 +01:00
parent bca335d4b2
commit e9a8112196

View File

@ -180,12 +180,15 @@ bool VTKParser::parse(QFile *file, QList<TrackData> &tracks,
_errorString = "";
while (true) {
len = file->read((char*)&recordLen, 2);
if (len < 0) {
_errorString = "I/O error";
return false;
} else if (len == 0)
break;
if ((len = file->read((char*)&recordLen, sizeof(recordLen)))
!= sizeof(recordLen)) {
if (!len)
break;
else {
_errorString = "Error reading VTK record size";
return false;
}
}
recordLen = qFromLittleEndian(recordLen);
ba.resize(recordLen);