Fixed openjpeg.c for proper initialization of codec context structures (dinfo in opj_create_compress() and opj_create_decompress(). Bug fix suggested by Andrey V. Kiselev

Clean up of opj_aligned_malloc(), to just forgo the use of posix_memalign(), as apparently memalign() is what is working better for everyone. Patch by Callum.
This commit is contained in:
Francois-Olivier Devaux
2008-02-29 09:33:41 +00:00
parent 396cb1e102
commit 6d1f3ecc9f
3 changed files with 13 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ const char* OPJ_CALLCONV opj_version(void) {
}
opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format) {
opj_dinfo_t *dinfo = (opj_dinfo_t*)opj_malloc(sizeof(opj_dinfo_t));
opj_dinfo_t *dinfo = (opj_dinfo_t*)opj_calloc(sizeof(opj_dinfo_t));
if(!dinfo) return NULL;
dinfo->is_decompressor = true;
switch(format) {
@@ -169,7 +169,7 @@ opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo, opj_cio_t *ci
}
opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format) {
opj_cinfo_t *cinfo = (opj_cinfo_t*)opj_malloc(sizeof(opj_cinfo_t));
opj_cinfo_t *cinfo = (opj_cinfo_t*)opj_calloc(sizeof(opj_cinfo_t));
if(!cinfo) return NULL;
cinfo->is_decompressor = false;
switch(format) {