diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-08-09 11:34:08 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-08-09 11:34:08 +0200 |
| commit | ac375ac9f5b4ae47501b60795e905e3d25dd00f8 (patch) | |
| tree | 8652897719b54db0a388fde6efe88d0ab1d72101 /tests | |
| parent | c38bdbef4f3a5888948903247532fc8cf4284c00 (diff) | |
Partial revert BPC related check of #975 (#979)
PR #975 introduced a check that rejects images that have different bit depth/sign
per compoment in SIZ marker if the JP2 IHDR box has BPC != 255
This didn't work properly if decoding a .j2k file since the new bit added in
opj_cp_t wasn't initialized to the right value.
For clarity, tThis new bit has also been renamed to allow_different_bit_depth_sign
But looking closer at the code, it seems we were already tolerant to inconsistencies.
For example we parsed a JP2 BPCC box even if BPC != 255 (just a warning is emitted)
So failing hard in opj_j2k_read_siz() wouldn't be very inconsistent, and that
alone cannot protect against other issues, so just emit a warning if BPC != 255
and the SIZ marker contains different bit depth/sign per component.
Note: we could also check that the content of JP2 BPCC box is consistant with the one
of the SIZ marker.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/nonregression/md5refs.txt | 4 | ||||
| -rw-r--r-- | tests/nonregression/test_suite.ctest.in | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/nonregression/md5refs.txt b/tests/nonregression/md5refs.txt index 2492ed52..a2cda422 100644 --- a/tests/nonregression/md5refs.txt +++ b/tests/nonregression/md5refs.txt @@ -300,3 +300,7 @@ f3081c8e9e9a175f223382a7443b480f issue559-eci-091-CIELab.jp2_2.pgx 3bf91c974abc17e520c6a5efa883a58a issue653-zero-unknownbox.jp2.png 8d7a866d29d5c68dc540b0f0011959a5 issue726.png 3bf91c974abc17e520c6a5efa883a58a issue818.png +3c7ff2e4bdae849167be36589f32bcd5 issue979.j2k_0.pgx +f004b48eafb2e52529cc9c7b6a3ff5d2 issue979.j2k_1.pgx +3127bd0a591d113c3c2428c8d2c14ec8 issue979.j2k_2.pgx +dacaf60e4c430916a8c2a9ebec32e71c issue979.j2k_3.pgx
\ No newline at end of file diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in index ff05f7a0..aaf40d7d 100644 --- a/tests/nonregression/test_suite.ctest.in +++ b/tests/nonregression/test_suite.ctest.in @@ -594,3 +594,6 @@ opj_decompress -i @INPUT_NR_PATH@/issue818.jp2 -o @TEMP_PATH@/issue818.png !opj_decompress -i @INPUT_NR_PATH@/issue826.jp2 -o @TEMP_PATH@/issue826.png # issue 820 !opj_decompress -i @INPUT_NR_PATH@/issue820.jp2 -o @TEMP_PATH@/issue820.png + +# issue 979 (.j2k with different bit depth per component) +opj_decompress -i @INPUT_NR_PATH@/issue979.j2k -o @TEMP_PATH@/issue979.j2k.pgx |
