[1.5] Check the number of tiles
[openjpeg.git] / libopenjpeg / image.c
index a4d2c010a56d1ab6863c60b5e1b604f92d6b9829..579fd73d71824f0f8e6127e2ea205de5e62e294e 100644 (file)
@@ -40,7 +40,7 @@ opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts, opj_image_cmptparm_t *c
                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);