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

fix: use opj_uint_ceildiv instead of opj_int_ceildiv when necessary #1482

Merged
merged 2 commits into from
Sep 23, 2023

Commits on Sep 23, 2023

  1. fix: use opj_uint_ceildiv instead of opj_int_ceildiv when necessary

    There are a bunch of loc where we can see a usage of `opj_int_ceildiv`:
    ```
    (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)a, (OPJ_INT32)b);
    ```
    where a & b are `OPJ_UINT32`.
    
    This can lead to overflow/underflow for some a/b combinations.
    Replace those calls by `opj_uint_ceildiv` instead to always get a correct result.
    
    This also allows some valid single tile images with huge tile size to be decoded properly.
    Fix uclouvain#1438
    mayeut committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    d23e028 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dc194c2 View commit details
    Browse the repository at this point in the history