Commit b740b68
committed
Fix AV1 packetizer length field for 127-byte fragments
packetize(List) used the 2-byte LEB128 length branch for any fragment
>= 127 bytes, but 127 fits in a single LEB128 byte (0x7F). For an exactly
127-byte fragment LEB128.encode returned 0x7F and the 2-byte split wrote
a malformed length of [0x00, 0x7F]; the depacketizer then read a
zero-length fragment followed by a spurious second OBU, splitting one OBU
into two and corrupting the frame.
Use the 2-byte branch only for sizes > 127. Verified: a frame whose final
fragment is exactly 127 bytes now reconstructs to a single OBU of the
full length (previously two elements).
Caught by the byte-for-byte AV1 framing self-check added on the consumer
side.1 parent e11a662 commit b740b68
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| |||
0 commit comments