2.2.6.1.1 Extensible Blob Version 1 Restrictions and Validation
Before parsing the data in the blob, implementations MUST verify its validity as follows:
The blob size MUST be at least four bytes.
The blob MUST have a SegmentAgeUnits value in the range of 1 to 4.
The blob size specified by the enclosing message MUST be equal to or larger than the size needed to accommodate the number of ENCODED_SEGMENT_AGE structures specified by SegmentAgeCount, plus four bytes for the previously specified blob layout. That includes the following.
Specified_size >= 4 + SegmentAgeCount * sizeof(ENCODED_SEGMENT_AGE) = 4 + SegmentAgeCount * 4 = 4 * (SegmentAgeCount + 1)
The previous validations MUST be carried out in the specified order and MUST be aborted at the first failure. If validation fails, the blob MUST be discarded.