1diff --git a/third_party/libopenjpeg20/jp2.c b/third_party/libopenjpeg20/jp2.c
2index da4e05f82..c9562f705 100644
3--- a/third_party/libopenjpeg20/jp2.c
4+++ b/third_party/libopenjpeg20/jp2.c
5@@ -1073,8 +1073,8 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
6             assert(pcol == 0);
7             new_comps[i] = old_comps[cmp];
8         } else {
9-            assert(i == pcol);
10-            new_comps[pcol] = old_comps[cmp];
11+            assert( i == pcol ); // probably wrong?
12+            new_comps[i] = old_comps[cmp];
13         }
14
15         /* Palette mapping: */
16@@ -1102,19 +1102,19 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
17         pcol = cmap[i].pcol;
18         src = old_comps[cmp].data;
19         assert(src); /* verified above */
20-        max = new_comps[pcol].w * new_comps[pcol].h;
21+        max = new_comps[i].w * new_comps[i].h;
22
23         /* Direct use: */
24         if (cmap[i].mtyp == 0) {
25-            assert(cmp == 0);
26+            assert( cmp == 0 ); // probably wrong.
27             dst = new_comps[i].data;
28             assert(dst);
29             for (j = 0; j < max; ++j) {
30                 dst[j] = src[j];
31             }
32         } else {
33-            assert(i == pcol);
34-            dst = new_comps[pcol].data;
35+            assert( i == pcol ); // probably wrong?
36+            dst = new_comps[i].data;
37             assert(dst);
38             for (j = 0; j < max; ++j) {
39                 /* The index */
40