diff options
| author | Mickael Savinaud <savmickael@users.noreply.github.com> | 2013-03-17 18:27:41 +0000 |
|---|---|---|
| committer | Mickael Savinaud <savmickael@users.noreply.github.com> | 2013-03-17 18:27:41 +0000 |
| commit | f769d5e27f890ea1bb33b70e1d72b28b551d49f6 (patch) | |
| tree | 06fd6fe5046ed38199c7a17c4dce6a03ba6b2630 /src | |
| parent | 1e414c8f37e0f392bf1867b614023e9a2ed09d3a (diff) | |
[trunk] manage correctly the case where meth value is not correct (thanks winfried)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/openjp2/jp2.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c index 5f2390f3..77df1529 100644 --- a/src/lib/openjp2/jp2.c +++ b/src/lib/openjp2/jp2.c @@ -1103,6 +1103,8 @@ OPJ_BOOL opj_jp2_read_colr( opj_jp2_t *jp2, } opj_read_bytes(p_colr_header_data,&jp2->enumcs ,4); /* EnumCS */ + + jp2->color.jp2_has_colr = 1; } else if (jp2->meth == 2) { /* ICC profile */ @@ -1124,14 +1126,17 @@ OPJ_BOOL opj_jp2_read_colr( opj_jp2_t *jp2, ++p_colr_header_data; jp2->color.icc_profile_buf[it_icc_value] = (OPJ_BYTE) l_value; } - + + jp2->color.jp2_has_colr = 1; } - else - opj_event_msg(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), so we will skip the fields following the approx field.\n", jp2->meth); - - jp2->color.jp2_has_colr = 1; - - return OPJ_TRUE; + else if (jp2->meth > 2) + { + /* ISO/IEC 15444-1:2004 (E), Table I.9 Legal METH values: + conforming JP2 reader shall ignore the entire Colour Specification box.*/ + opj_event_msg(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), " + "so we will ignore the entire Colour Specification box. \n", jp2->meth); + } + return OPJ_TRUE; } OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2, |
