mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix FitRideFile for header change
The header size in FitRideFile has increased from 12 to 14 bytes, but the new field is at the end of the header, not in the middle. Additionally, there is a new global record (79) which we now silently ignore.
This commit is contained in:
@@ -524,6 +524,7 @@ struct FitFileReaderState
|
||||
case 72: /* undocumented - new for garmin 800*/
|
||||
case 34: /* activity */
|
||||
case 49: /* file creator */
|
||||
case 79: /* unknown */
|
||||
break;
|
||||
default:
|
||||
unknown_global_msg_nums.insert(def.global_msg_num);
|
||||
@@ -553,7 +554,6 @@ struct FitFileReaderState
|
||||
// if the header size is 14 we have profile minor then profile major
|
||||
// version. We still don't do anything with this information
|
||||
int profile_version = read_uint16(false); // always littleEndian
|
||||
if (header_size == 14) profile_version = read_uint16(false);
|
||||
(void) profile_version; // not sure what to do with this
|
||||
|
||||
int data_size = read_uint32(false); // always littleEndian
|
||||
@@ -569,6 +569,10 @@ struct FitFileReaderState
|
||||
delete rideFile;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// read the rest of the header
|
||||
if (header_size == 14) read_uint16(false);
|
||||
|
||||
int bytes_read = 0;
|
||||
bool stop = false;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user