Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CP] Fix erroneous cross-segment start code.
Fix erroneous cross-segment start code. A slice NAL can be divided in to 1) encrypted 16-byte aligned segment and 2) not aligned the trailing bytes. The original MergeEncryptedNalUnit can only prevent erroneous starting code placed completely inside a segment. The bug in this case is that, a `00 01` is at the start of the 2nd segment of a slice, and when the 1st segment's last encrypted byte is encrypted to `00`, it forms a erroneous cross-segment start code `00 00 01`, which leads to erroneous header parsing. This PR add additional check for cross-segment start code in PXP's h265 header parsing. Previously, when parsed NAL unit's length is less than segment's length, if the additional bytes in that segment is all 0, it would be considered trailing 0, and simple expand the NAL units to cover the entire segment. In this PR, we check bytes across segment to make sure there is no cross-segment `00 00 01`.
- Loading branch information