diff --git a/CHANGES b/CHANGES index e8eb6a85..6ced3180 100644 --- a/CHANGES +++ b/CHANGES @@ -6,9 +6,8 @@ What's New for OpenJPEG + : added September 19, 2011 ++ [mickael] WIP: manage the case of event_mgr is not provided to setup_decoder function + [mickael] WIP: insert elements from V2 framework into the trunk (add missing files). - -September 19, 2011 + [mickael] Work In Progress: insert elements from V2 framework into the trunk. September 9, 2011 diff --git a/libopenjpeg/openjpeg.c b/libopenjpeg/openjpeg.c index 9c5db9e1..da3fe0d2 100644 --- a/libopenjpeg/openjpeg.c +++ b/libopenjpeg/openjpeg.c @@ -386,7 +386,16 @@ opj_bool OPJ_CALLCONV opj_setup_decoder_v2(opj_codec_t *p_info, opj_dparameters_ } l_info->m_codec_data.m_decompression.opj_setup_decoder(l_info->m_codec,parameters); - l_info->m_event_mgr = event_mgr; + + if (event_mgr == NULL) + { + l_info->m_event_mgr->error_handler = opj_default_callback ; + l_info->m_event_mgr->warning_handler = opj_default_callback ; + l_info->m_event_mgr->info_handler = opj_default_callback ; + l_info->m_event_mgr->client_data = stderr; + } + else + l_info->m_event_mgr = event_mgr; return OPJ_TRUE; } return OPJ_FALSE;