Repository navigation
Conversation
This branch has not been deployed
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.
ojph_expandonly compares XRsiz/YRsiz across components before writing.ppm,.pfmor.tif, then sizes the writer from component 0's reconstructed width and height. With-skip_res, a COC that points some components at a vertical-only DFS changes their reconstructed size without touching XRsiz/YRsiz, soppm_out::write(and the pfm/tif writers) read component 0's width of samples from the shorter line buffers of the other components, and the stale bytes end up in the output file. ASan does not flag it because the lines sit inside the codestream's pooled allocation. With a horizontal-only DFS the heights differ instead, and the interleaved pull loop inojph_expandnever terminates.Repro: a 4096x32, 3-component reversible stream with a DFS segment (every level vertical-only) and COC segments selecting it for components 0 and 1, decoded with
ojph_expand -i dfs.j2c -o out.ppm -skip_res 5,5, writes a 4096x1 PPM whose third channel holds 128 decoded samples followed by 3968 values read past component 2's 128-sample line. With the patch it stops with the existing "same downsampling ratio" error, normal files (with and without-skip_res) decode as before, and the 138 tests pass.