From 98cfdd31340509895f3e2a36f667f66bb3cf1ff2 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 30 Nov 2017 14:48:34 +0100 Subject: opj_j2k_read_cod: remove check for 'No more than one COD marker per tile' (fixes #1043) This check was added per https://github.com/uclouvain/openjpeg/commit/daed8cc9195555e101ab708a501af2dfe6d5e001 to fix https://github.com/uclouvain/openjpeg/issues/476 , but it does not seem to be necessary with latest master (issue476.jp2 doesn't cause memory issues), and breaks reading legit files. --- src/lib/openjp2/j2k.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index e283884f..6e9cf8ce 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -2657,12 +2657,17 @@ static OPJ_BOOL opj_j2k_read_cod(opj_j2k_t *p_j2k, &l_cp->tcps[p_j2k->m_current_tile_number] : p_j2k->m_specific_param.m_decoder.m_default_tcp; +#if 0 + /* This check was added per https://github.com/uclouvain/openjpeg/commit/daed8cc9195555e101ab708a501af2dfe6d5e001 */ + /* but this is no longer necessary to handle issue476.jp2 */ + /* and this actually cause issues on legit files. See https://github.com/uclouvain/openjpeg/issues/1043 */ /* Only one COD per tile */ if (l_tcp->cod) { opj_event_msg(p_manager, EVT_ERROR, "COD marker already read. No more than one COD marker per tile.\n"); return OPJ_FALSE; } +#endif l_tcp->cod = 1; /* Make sure room is sufficient */ -- cgit v1.2.3