Expand description
Integrity of the sensor payload: structured truncation reports, decode warnings, and the range checks every format runs before it reads sensor bytes.
A strip, tile or other sensor-data range that extends past the end of the file is
corruption, and never silent. Under the recover policy (the default,
DecodeContext::recover) the decoder uses every complete sample it has, fills the
rest with zeros and records a DecodeWarning. Under the strict policy it fails the
decode with an Error::CorruptFile whose CorruptReason::Truncated carries the
expected range, the bytes actually present and the file length.
Tolerances (data that is short but still complete):
- Only the bytes the geometry needs are required: the last row needs its samples, not its padding to the full stride, and a declared length beyond that need (end padding) may run past the end of the file.
- Formats addressed purely by geometry may read past a declared byte count that is too small when the file holds the bytes (some writers understate it).
Structs§
- Decode
Warning - Something a decode repaired or substituted instead of failing: under the recover policy
(truncated or corrupt units), or with the preview fallback (see
CorruptReason::PreviewFallback). - RowGeometry
- Geometry of a row-structured payload, used to work out how many bytes are needed and how many samples a truncated range still holds.
- Sensor
Bytes - Sensor bytes of one unit, as resolved by
DecodeContext::sensor_bytes. - Truncation
- A sensor-data range that the file does not fully contain.
Enums§
- Corrupt
Reason - Structured cause of an
Error::CorruptFile(or of a recoveredDecodeWarning). - Data
Unit - Which part of the sensor payload a report refers to.
Functions§
- check_
range - Check that
[offset, offset + needed)lies within an input offile_lenbytes. Nothing is missing from an empty range, wherever it starts.