X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fopenjp2%2Fjp2.c;h=a2363666c90ca70660616abef50a764360db21c9;hb=64689d05dfaaf52105581d93fb1eb173b20829a4;hp=f15f45ae7718dea4e20855e60bf86b6406a1b9c2;hpb=ccc4441aeb7bf4928e55bd543fab8de662f6d5e7;p=openjpeg.git diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c index f15f45ae..a2363666 100644 --- a/src/lib/openjp2/jp2.c +++ b/src/lib/openjp2/jp2.c @@ -1079,7 +1079,7 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image, /* Palette mapping: */ new_comps[i].data = (OPJ_INT32*) - opj_image_data_alloc(old_comps[cmp].w * old_comps[cmp].h * sizeof(OPJ_INT32)); + opj_image_data_alloc(sizeof(OPJ_INT32) * old_comps[cmp].w * old_comps[cmp].h); if (!new_comps[i].data) { while (i > 0) { -- i; @@ -1106,7 +1106,6 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image, /* Direct use: */ if (cmap[i].mtyp == 0) { - assert(cmp == 0); dst = new_comps[i].data; assert(dst); for (j = 0; j < max; ++j) { @@ -1194,8 +1193,8 @@ static OPJ_BOOL opj_jp2_read_pclr(opj_jp2_t *jp2, return OPJ_FALSE; } - entries = (OPJ_UINT32*) opj_malloc((size_t)nr_channels * nr_entries * sizeof( - OPJ_UINT32)); + entries = (OPJ_UINT32*) opj_malloc(sizeof(OPJ_UINT32) * nr_channels * + nr_entries); if (!entries) { return OPJ_FALSE; } @@ -1585,9 +1584,7 @@ static OPJ_BOOL opj_jp2_read_colr(opj_jp2_t *jp2, "COLR BOX meth value is not a regular value (%d), " "so we will ignore the entire Colour Specification box. \n", jp2->meth); } - if (jp2->color.jp2_has_colr) { - jp2->j2k->enumcs = jp2->enumcs; - } + return OPJ_TRUE; }