From: Mathieu Malaterre Date: Thu, 26 Sep 2013 09:28:47 +0000 (+0000) Subject: [trunk] Import patch from bug #241 X-Git-Tag: version.2.0.1~4^2~275 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5855da5a156443f470a0c446e1740ab8aaf09230;p=openjpeg [trunk] Import patch from bug #241 --- diff --git a/src/lib/openjp2/image.c b/src/lib/openjp2/image.c index 7e48de1a..1b14f685 100644 --- a/src/lib/openjp2/image.c +++ b/src/lib/openjp2/image.c @@ -40,7 +40,7 @@ opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptpa image->color_space = clrspc; image->numcomps = numcmpts; /* allocate memory for the per-component information */ - image->comps = (opj_image_comp_t*)opj_malloc(image->numcomps * sizeof(opj_image_comp_t)); + image->comps = (opj_image_comp_t*)opj_calloc(1,image->numcomps * sizeof(opj_image_comp_t)); if(!image->comps) { fprintf(stderr,"Unable to allocate memory for image.\n"); opj_image_destroy(image); diff --git a/src/lib/openjp2/openjpeg.c b/src/lib/openjp2/openjpeg.c index e7ca5f80..78b5a564 100644 --- a/src/lib/openjp2/openjpeg.c +++ b/src/lib/openjp2/openjpeg.c @@ -850,10 +850,9 @@ OPJ_BOOL OPJ_CALLCONV opj_encode(opj_codec_t *p_info, opj_stream_t *p_stream) opj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream; if (! l_codec->is_decompressor) { - l_codec->m_codec_data.m_compression.opj_encode( l_codec->m_codec, + return l_codec->m_codec_data.m_compression.opj_encode( l_codec->m_codec, l_stream, &(l_codec->m_event_mgr)); - return OPJ_TRUE; } }