Skip to content

Commit

Permalink
Use opj_image_data_free() where appropriate (adapted from dab9db0, #1014
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rouault committed Sep 8, 2017
1 parent 5abd86b commit b73ce71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/openjp2/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjp2/jp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b73ce71

Please sign in to comment.