X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fopenjp2%2Fimage.c;h=8e68668e42758a97d7e61d18017f26115a342835;hb=6868ee373ecc69ac472b6d61decc4741723c1540;hp=24f868d45c6006fed3c8ddc9f94bee47f3a46cc4;hpb=e238148d4241884157f5b6a0ac72d8f2739f6f3f;p=openjpeg.git diff --git a/src/lib/openjp2/image.c b/src/lib/openjp2/image.c index 24f868d4..8e68668e 100644 --- a/src/lib/openjp2/image.c +++ b/src/lib/openjp2/image.c @@ -1,4 +1,9 @@ /* + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third + * party and contributor rights, including patent rights, and no such rights + * are granted under this license. + * * Copyright (c) 2005, Herve Drolon, FreeImage Team * All rights reserved. * @@ -200,21 +205,19 @@ opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_c OPJ_UINT32 compno; opj_image_t *image = 00; - image = (opj_image_t*) opj_malloc(sizeof(opj_image_t)); + image = (opj_image_t*) opj_calloc(1,sizeof(opj_image_t)); if (image) { - memset(image,0,sizeof(opj_image_t)); 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(image->numcomps, sizeof(opj_image_comp_t)); if (!image->comps) { opj_image_destroy(image); return 00; } - memset(image->comps,0,image->numcomps * sizeof(opj_image_comp_t)); /* create the individual image components */ for(compno = 0; compno < numcmpts; compno++) {