summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/0035-opj_image_data_free.patch
blob: 8bd03a214e2d010605087064ea159449210998e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/third_party/libopenjpeg20/image.c b/third_party/libopenjpeg20/image.c
index e29172b2b..bf7a70194 100644
--- a/third_party/libopenjpeg20/image.c
+++ b/third_party/libopenjpeg20/image.c
@@ -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);
diff --git a/third_party/libopenjpeg20/jp2.c b/third_party/libopenjpeg20/jp2.c
index 9178f3fd6..e7e2db8bb 100644
--- a/third_party/libopenjpeg20/jp2.c
+++ b/third_party/libopenjpeg20/jp2.c
@@ -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,
@@ -1107,7 +1107,7 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
         /* Prevent null pointer access */
         if (!src || !dst) {
           for (j = 0; j < nr_channels; ++j) {
-            opj_free(new_comps[j].data);
+            opj_image_data_free(new_comps[j].data);
           }
           opj_free(new_comps);
           new_comps = NULL;