Use opj_image_data_free() where appropriate (adapted from dab9db0723, #1014)

This commit is contained in:
Even Rouault 2017-09-08 09:16:51 +02:00
parent 5abd86b14b
commit b73ce715d2
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ void opj_copy_image_header(const opj_image_t* p_image_src,
for (compno = 0; compno < p_image_dest->numcomps; compno++) {
opj_image_comp_t *image_comp = &(p_image_dest->comps[compno]);
if (image_comp->data) {
opj_free(image_comp->data);
opj_image_data_free(image_comp->data);
}
}
opj_free(p_image_dest->comps);

View File

@ -1083,7 +1083,7 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
if (!new_comps[i].data) {
while (i > 0) {
-- i;
opj_free(new_comps[i].data);
opj_image_data_free(new_comps[i].data);
}
opj_free(new_comps);
opj_event_msg(p_manager, EVT_ERROR,