Can't read MAT file saved with non-native endianness
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HF-Lab |
Triaged
|
Low
|
Matt Giuca |
Bug Description
The MAT (Matlab) heightfield file format supports both big-endian and little-endian floating-point numbers. HF-Lab writes whichever format is native to the current machine (which is fine). However, it refuses to read a MAT file saved in a non-native endianness. Little-endian machines can only read MAT files saved by little-endian machines, and same for big-endian. If the file has non-native endianness, it prints "Unsupported file format type".
hf_io.c:read_mfile explicitly compares the endianness of the MAT file against NUM_FMT (this machine's endianness), and rejects the file if it does not match.
Instead, it should actually be able to process non-native-