summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-26 11:22:34 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-26 11:22:34 +0000
commit51e3764519d77210f8e6bb707fbe009fcf867a87 (patch)
tree3691d8159c7954078e31642e04481d182e5e3aed /src/lib
parent533d92aa8e586dfd35cba92f467261ea400871eb (diff)
[trunk] Import patch from sumatrapdf team. This handle some Part-2 compliant file, by being more tolerant in COLR box. No testcase for now.
Fixes issue 247
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/jp2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c
index 0af1f960..f8eb907d 100644
--- a/src/lib/openjp2/jp2.c
+++ b/src/lib/openjp2/jp2.c
@@ -1222,10 +1222,14 @@ OPJ_BOOL opj_jp2_read_colr( opj_jp2_t *jp2,
++p_colr_header_data;
if (jp2->meth == 1) {
- if (p_colr_header_size != 7) {
- opj_event_msg(p_manager, EVT_ERROR, "Bad BPCC header box (bad size)\n");
+ if (p_colr_header_size < 7) {
+ opj_event_msg(p_manager, EVT_ERROR, "Bad COLR header box (bad size: %d)\n", p_colr_header_size);
return OPJ_FALSE;
}
+ if (p_colr_header_size > 7) {
+ /* testcase Altona_Technical_v20_x4.pdf */
+ opj_event_msg(p_manager, EVT_WARNING, "Bad COLR header box (bad size: %d)\n", p_colr_header_size);
+ }
opj_read_bytes(p_colr_header_data,&jp2->enumcs ,4); /* EnumCS */