xref: /aosp_15_r20/external/pdfium/third_party/libopenjpeg/0035-opj_image_data_free.patch (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1diff --git a/third_party/libopenjpeg/jp2.c b/third_party/libopenjpeg/jp2.c
2index dcaf3872c..02f3d04c7 100644
3--- a/third_party/libopenjpeg/jp2.c
4+++ b/third_party/libopenjpeg/jp2.c
5@@ -1122,7 +1122,7 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
6         /* Prevent null pointer access */
7         if (!src || !dst) {
8           for (j = 0; j < nr_channels; ++j) {
9-            opj_free(new_comps[j].data);
10+            opj_image_data_free(new_comps[j].data);
11           }
12           opj_free(new_comps);
13           new_comps = NULL;
14