Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to validate SGcod/SPcoc/SPcod parameter values. #1211

Merged
merged 2 commits into from
May 20, 2020

Commits on Sep 4, 2019

  1. openjp2/j2k: Make comments adhere to specification.

    The function is used to read both SPcod and SPcoc, so all
    comments should refer to both marker segments' parameter names.
    sebras committed Sep 4, 2019
    Configuration menu
    Copy the full SHA
    d801bd4 View commit details
    Browse the repository at this point in the history
  2. openjp2/j2k: Validate all SGcod/SPcod/SPcoc parameter values.

    Previously the multiple component transformation SGcod(C)
    and wavelet transformation SPcod(H)/SPcoc(E) parameter
    values were never checked, allowing for out of range values.
    
    The lack of validation allowed the bit stream provided in
    issue uclouvain#1158 through. After this commit an error message
    points to the marker segments' parameters as being out of
    range.
    
    input/nonregression/edf_c2_20.jp2 contains an SPcod(H) value
    of 17, but according to Table A-20 of the specification only
    values 0 and 1 are valid. input/nonregression/issue826.jp2
    contains a SGcod(B) value of 2, but according to Table A-17
    of the specification only values 0 and 1 are valid.
    input/nonregression/oss-fuzz2785.jp2 contains a SGcod(B)
    value of 32, but it is likewise limited to 0 or 1. These test
    cases have been updated to consistently fail to parse the
    headers since they contain out of bounds values.
    
    This fixes issue uclouvain#1210.
    sebras committed Sep 4, 2019
    Configuration menu
    Copy the full SHA
    f3ee448 View commit details
    Browse the repository at this point in the history