FIT File Read - Exception not catched

... exception "Truncated" for the "final" read call of the FIT file
reader was not catched, causing termination of the program (problem
reported with an example file being truncated at the end)
This commit is contained in:
Joern
2015-06-04 17:16:54 +02:00
parent cbad81b846
commit 0fac48d451

View File

@@ -1008,8 +1008,14 @@ struct FitFileReaderState
}
else {
if (!truncated) {
int crc = read_uint16( false ); // always littleEndian
(void) crc;
try {
int crc = read_uint16( false ); // always littleEndian
(void) crc;
}
catch (TruncatedRead &e) {
errors << "truncated file body";
return NULL;
}
}
foreach(int num, unknown_global_msg_nums)