Skip to content

[FIX] Bound CDP caption data by packet length - #2431

Closed
harshalsp07 wants to merge 2 commits into
CCExtractor:masterfrom
harshalsp07:codex/fix-cdp-count-2425
Closed

harshalsp07 wants to merge 2 commits into
CCExtractor:masterfrom
harshalsp07:codex/fix-cdp-count-2425

Conversation

@harshalsp07

@harshalsp07 harshalsp07 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The CDP parser now checks that the declared caption triplets fit before the packet footer and that the copied bytes fit in the demuxer buffer. Malformed counts return CCX_EINVAL.

The parser previously trusted the 5-bit cc_count and could read beyond a short packet while copying caption data.

Added three cases to the repository Check suite: reject the issue’s malformed 16-byte CDP, accept a valid one-triplet CDP, and reject a write that exceeds the destination buffer.

Validation:

  • An AddressSanitizer/UBSan harness compiled against ccx_gxf.c rejected the malformed packet, preserved all three caption bytes from a valid packet, and rejected insufficient destination capacity.
  • The same harness against upstream/master reports an AddressSanitizer stack-buffer-overflow in the original copy loop.
  • The added suite and runner pass a C syntax check. The Check library is not installed here, so the suite itself could not be run.
  • git diff --check passed.
  • CMake configuration could not complete because the required gpac package is not installed, so the full application build and end-to-end GXF repro remain unverified.

@harshalsp07
harshalsp07 deleted the codex/fix-cdp-count-2425 branch October 27, 2026 18:47
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