1diff --git a/third_party/libopenjpeg20/jp2.c b/third_party/libopenjpeg20/jp2.c 2index f3ccb9974..882f1b649 100644 3--- a/third_party/libopenjpeg20/jp2.c 4+++ b/third_party/libopenjpeg20/jp2.c 5@@ -1624,7 +1624,7 @@ OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2, 6 /* Part 1, I.5.3.4: Either both or none : */ 7 if (!jp2->color.jp2_pclr->cmap) { 8 opj_jp2_free_pclr(&(jp2->color)); 9- } else { 10+ } else if (p_image->pdfium_use_colorspace) { 11 if (!opj_jp2_apply_pclr(p_image, &(jp2->color), p_manager)) { 12 return OPJ_FALSE; 13 } 14diff --git a/third_party/libopenjpeg20/openjpeg.h b/third_party/libopenjpeg20/openjpeg.h 15index d571c516e..e8dbe4ff7 100644 16--- a/third_party/libopenjpeg20/openjpeg.h 17+++ b/third_party/libopenjpeg20/openjpeg.h 18@@ -682,6 +682,10 @@ typedef struct opj_image { 19 OPJ_BYTE *icc_profile_buf; 20 /** size of ICC profile */ 21 OPJ_UINT32 icc_profile_len; 22+ 23+ 24+ /** Whether to apply PCLR or not */ 25+ OPJ_BOOL pdfium_use_colorspace; 26 } opj_image_t; 27 28 29