[trunk] Import patch from bug #241
This commit is contained in:
parent
34fd493512
commit
5855da5a15
|
@ -40,7 +40,7 @@ opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptpa
|
||||||
image->color_space = clrspc;
|
image->color_space = clrspc;
|
||||||
image->numcomps = numcmpts;
|
image->numcomps = numcmpts;
|
||||||
/* allocate memory for the per-component information */
|
/* 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) {
|
if(!image->comps) {
|
||||||
fprintf(stderr,"Unable to allocate memory for image.\n");
|
fprintf(stderr,"Unable to allocate memory for image.\n");
|
||||||
opj_image_destroy(image);
|
opj_image_destroy(image);
|
||||||
|
|
|
@ -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;
|
opj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;
|
||||||
|
|
||||||
if (! l_codec->is_decompressor) {
|
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_stream,
|
||||||
&(l_codec->m_event_mgr));
|
&(l_codec->m_event_mgr));
|
||||||
return OPJ_TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue