Skip to content

Accept NUL-terminated embedded ASS headers and packets from FFmpeg - #641

Merged
GLinnik21 merged 9 commits into
plxnative:mainfrom
sh-k-l:fix/ass-header-terminator
Oct 14, 2026
Merged

GLinnik21 merged 9 commits into
plxnative:mainfrom
sh-k-l:fix/ass-header-terminator

Conversation

@sh-k-l

@sh-k-l sh-k-l commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fix embedded ASS subtitles that show permanent "invalid track" or "invalid events" warnings because their headers and packets end with NUL bytes.

Remove trailing NULs while retaining size limits and validation. Drop malformed packets so valid captions on the same track still render. Empty or missing headers report an invalid track.

Tested manually on the TV with the original episode at 1bc0d547. ASS subtitles now work on this branch, where they failed on main.

Automated regression tests check caption pixels through both subtitle readers. Host checks, seven native FFmpeg/ASS tests, the shipping feature check, ARM builds, and firmware compatibility checks passed. PR CI checks also passed.

sh-k-l and others added 9 commits October 12, 2026 21:22
Remove trailing zero terminators before storing embedded ASS headers. Keep the raw size bound and rejection of zero bytes inside header text.

Add the supplied 521-byte header and a generated MKV control fixture. Native regressions cover main subtitle ingestion, the HTTP side reader, caption pixels, timing, source reuse, and malformed headers. Build libass before the FFmpeg native test target.
…odule docs the change made stale

push and begin trimmed trailing NULs but were only covered by macOS-only #[ignore]
native tests, so make check never ran them. The new test goes through the real
begin/push, then ass::validate (now pub(super)), for: trimmed packet and header, a
NUL inside kept and rejected as InvalidTrack/InvalidEvents, empty and all-NUL
headers invalid, empty/all-NUL/inner-NUL packets dropped without costing a valid
caption. Shown red against a no-op trim_terminators and a no-op trim in push.

The ass_source.rs and ff_image_subtitle_tests.rs module docs said the demuxer
preserves headers/packets and that no other ff test touches av_*; both now say what
the code does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…so the comment's count and the rule agree

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 1331b7a into plxnative:main Oct 14, 2026
16 checks passed
@GLinnik21

Copy link
Copy Markdown
Collaborator

Merged, thank you @sh-k-l! Great work.

GLinnik21 added a commit that referenced this pull request Oct 22, 2026
* Release notes and audit for v0.9.0

Action-required evaluation (README trigger list, read from the PRs, grep not run on a built tree): no hits that need a reader action. Launch links (#853) add an inbound surface (any app that can launch apps), stated in What's new; the 3.4 image cache writes to /media/developer/temp (#667); crash/error reports gain fixed-value fields with POLICY_VERSION unchanged (#632), stated under Changed; Watchlist and PMS notifications use hosts the app already reaches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Release notes v0.9.0: coverage and accuracy pass

Note: correct the Collections surfaces (no TYPE menu; collection shelf
headings live on Home and a library's Recommended page), the Watchlist
hold-menu rows, the launch-link sign-in behaviour and platform-release
numbering, the notification-feed sentence and the per-profile settings
list (no stale "nine"). Add #832, #808, #750/#762, #709 (#628), #641,
#647, #793, #871, #877 (#679), #876 and the key-press frame work;
credit RichiL10 and Shakil Choudhury. #862 moves from Known issues to
the webOS 3.x lines as fixed by #578; the 3.9.3 source-build report
(#700) is kept in Compatibility. Compatibility links reports, not
reporters' profiles.

Audit: #862 provenance (attributed usage-report reading, no counts),
contributor list wording.

Action-required section: not owed. The README grep over
v0.8.0..origin/main (rust-modules/src src ci) hits only CI tooling,
test-only loopback listeners and fixture tokens, and the dev-only
/tmp/plxnative-trackmemory trigger; the audit's PR-by-PR reading in
"Deliberately not done" stands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Release audit v0.9.0: name the toolchain by its pin file, not its version

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants