Repository navigation
Size unci generic-compression output exactly and fail allocations cleanly - #14
laurens-pilot wants to merge 1 commit into
Conversation
…anly Follow-ups to the review of ente#19. - size the compressed output budget from what the reader consumes in every interleave mode, so pixel_size layouts with sub-byte groups decode compressed and excess output is rejected - reject layouts whose padding exceeds 8x their non-padded sample data and 16 MiB before decompressing, and reject large-window brotli streams before the decoder can request a ring buffer of up to 1 GiB - report ResourceLimit instead of aborting when the unci payload, channel, RGBA, tile scratch, conversion or transform allocations fail, and when the decompressed output buffer cannot grow - check multi-y component roles and sampling before the budget, so unsupported layouts keep reporting UnsupportedFeature - compare the budget with the reader across generated layouts
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Superseded by ente#24. |
Follow-up to the review of ente#19.
Generic-compressed
unciitems now get an output budget that matches exactly what the reader consumes in every interleave mode.pixel_sizelayouts with sub-byte groups now decode compressed, and any decompressed bytes beyond the layout are rejected. Layouts whose padding (pixel_size, row or tile alignment, padded components) exceeds 8× their real sample data and 16 MiB are rejected before anything is decompressed, as are large-window brotli streams. Before this, a 232-byte file could make the brotli decoder request 1 GiB. Allocation failures on the unci decode path now reportResourceLimitinstead of aborting the process, including when the decompressed output buffer has to grow.Behaviour changes:
row_align_sizeare rejected, because the reader ignores that field. Plain copies still decode.DecodeUncompressedError::ResourceLimit,TransformGuardError::AllocationFailedandExtractUncompressedItemDataError::PayloadAllocationFailed. None of these enums isnon_exhaustive, so exhaustive downstream matches need updating.Known limits:
This overlaps with #13, which changes
pixel_sizeinto an exact stride. Whichever PR lands second must drop the one-byte residual inuncompressed_pixel_group_tile_size_bytes, and the new differential sweep test will fail until it does.