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.
param_nlt::read only checks that Dmin is smaller than Dmax as 32-bit integers, but nlt_rec::prepare_for_decoding maps both to floats in [0, 1], and two adjacent values such as 0xFFFFFFFE and 0xFFFFFFFF round to the same float, so the LUT ends up with a zero float range, an infinite inv_delta and a NaN index into the decode table. That reads the table out of bounds in the type 2 and type 4 irreversible NLT paths (ASan flags a wild read in the SSE2 code well before the table, and the generic path hits a NaN to unsigned conversion), and a crafted codestream can carry such an NLT marker segment. I reject the collapsing range in param_nlt::read right after the existing Dmin/Dmax integer check, computing the floats the same way the decoder does. The regression test in test_nlt.cpp inserts such a segment for both LUT types and checks that reading the headers rejects it; worth verifying that the new error path fires and that a normal full-range LUT still decodes, both of which I confirmed with the full suite (139 tests pass).