uclouvain/openjpeg#254 Add build option to disable the fix 514/head
authormayeut <mayeut@users.noreply.github.com>
Fri, 3 Jul 2015 22:04:55 +0000 (00:04 +0200)
committermayeut <mayeut@users.noreply.github.com>
Fri, 3 Jul 2015 22:04:55 +0000 (00:04 +0200)
src/lib/openjp2/CMakeLists.txt
src/lib/openjp2/j2k.c

index 5727068c2b44dcf8825cfdcc700f94dfa6defc54..0795f7c5b079d431e3e1c50a2db4312b76e5647f 100644 (file)
@@ -41,6 +41,11 @@ if(BUILD_JPIP)
   )
 endif()
 
+option(OPJ_DISABLE_TPSOT_FIX "Disable TPsot==TNsot fix. See https://github.com/uclouvain/openjpeg/issues/254." OFF)
+if(OPJ_DISABLE_TPSOT_FIX)
+  add_definitions(-DOPJ_DISABLE_TPSOT_FIX)
+endif()
+
 # Build the library
 if(WIN32)
   if(BUILD_SHARED_LIBS)
index 128c3a88f8aaf976a5389e6137376d6b28fe1928..6730154704924bb2068f89544699e42721f25a24 100644 (file)
@@ -8602,6 +8602,10 @@ opj_j2k_t* opj_j2k_create_decompress(void)
         l_j2k->m_is_decoder = 1;
         l_j2k->m_cp.m_is_decoder = 1;
 
+#ifdef OPJ_DISABLE_TPSOT_FIX
+        l_j2k->m_specific_param.m_decoder.m_nb_tile_parts_correction_checked = 1;
+#endif
+
         l_j2k->m_specific_param.m_decoder.m_default_tcp = (opj_tcp_t*) opj_calloc(1,sizeof(opj_tcp_t));
         if (!l_j2k->m_specific_param.m_decoder.m_default_tcp) {
                 opj_j2k_destroy(l_j2k);