Skip to content

Fix HRD buffering entry count and following field alignment - #9

Merged
antono3 merged 1 commit into
masterfrom
fix/hrd-entry-count-20261007
Oct 7, 2026
Merged

antono3 merged 1 commit into
masterfrom
fix/hrd-entry-count-20261007

Conversation

@antono3

@antono3 antono3 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

HRD parsing treated cpb_cnt_minus1 as the entry count. A valid single-CPB stream therefore skipped its buffering entry and decoded the following delay fields at the wrong bit position. Read all cpb_cnt_minus1 + 1 entries and reject counts above the 32-entry storage limit before indexing. This follows H.264 E.1.2 and E.2.2.

Add fixed encoded fixtures for 1, 2 and 32 entries, checking every entry, all delay fields and a following cursor sentinel. Document the coverage and count constraint.

Validation: the regression fails before the fix; the full suite passes with V 0.5.2 compatibility mode and current strict V3. A separate malformed 33-entry probe exits at the new count assertion. Linux, Windows/MSVC and pinned V3 checks run in CI.

@antono3
antono3 merged commit 09c12bb into master Oct 7, 2026
4 checks passed
@antono3
antono3 deleted the fix/hrd-entry-count-20261007 branch October 7, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant