Repository navigation
Port upstream #382: gate the ISOBMFF byte scan on an 8-byte tail - #32
Merged
Merged
Conversation
#371 limited the whole-file C2PA scan and the content-provenance user-type scan to a box walk that stopped early, but tested that as "stopped before the end of the data". The walk runs while pos + 8 <= length, so a complete container with 1 to 7 bytes of trailing padding passed the test and chance marker bytes in its media were reported as a manifest. Require at least 8 bytes left over, the room for a box header and the threshold the strip side already uses. Both drivers follow it. New fixtures cover tails of 1, 4, 7 and 8 bytes for the ASCII-marker and user-type scans, in MP4 and AVIF, plus a content-provenance box truncated before any ASCII marker. Twelve of them fail with the old gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream #382 fixes an off-by-a-header in #371, which v0.9.0 ported: the whole-file C2PA byte scan and the content-provenance user-type scan ran whenever the box walk ended before EOF. The walk needs 8 bytes to read a header, so a complete MP4, AVIF or HEIC with 1 to 7 bytes of padding re-enabled both scans, and chance
c2pabytes in the media were reported as a manifest.js/image_meta.js(inspectIsobmff, buffer driver) andjs/av_meta.js(inspectMp4File, slice driver):len - scannedEnd >= 8.scripts/upstream-sources.json:image_meta.pyre-anchored to upstreamc5297e9, comment updated.Not ported from the same range: #375 (SKILL.md), #376 (ruff bump), #379 (Codex skill installer).
Tests: 1778 passed, 0 skipped, against upstream
c5297e9;check-upstream.mjsreports all 12 sources matching.Closes #31