[trunk] Import patch from bug #241

This commit is contained in:
Mathieu Malaterre 2013-09-26 09:28:47 +00:00
parent 34fd493512
commit 5855da5a15
2 changed files with 2 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}
}