summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/0005-jp2_apply_pclr.patch
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-09-01 13:25:16 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-05 14:10:37 +0000
commit088ca03f25fe1f6d75c0ff3b71e0ad3d018a5e0c (patch)
tree27f55db27d9112910d9219efa58474a0c2bd9b52 /third_party/libopenjpeg20/0005-jp2_apply_pclr.patch
parent740bcd892d22136873b2b123b94e51bf6e77b8f9 (diff)
downloadpdfium-088ca03f25fe1f6d75c0ff3b71e0ad3d018a5e0c.tar.xz
Upgrade OpenJPEG to 2.2.0
This CL upgrades OpenJPEG by copying the files from 2.2.0 and then applying patches. Patch files that are no longer relevant are deleted. The relevant ones are applied manually due to changes in formatting in OpenJPEG. Patch 34 is added to account for opj_malloc changes in PDFium. Bug: chromium:718731 Change-Id: I3d316893eab5e235c9f71222a6818b8ae0c98383 Reviewed-on: https://pdfium-review.googlesource.com/12770 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'third_party/libopenjpeg20/0005-jp2_apply_pclr.patch')
-rw-r--r--third_party/libopenjpeg20/0005-jp2_apply_pclr.patch87
1 files changed, 43 insertions, 44 deletions
diff --git a/third_party/libopenjpeg20/0005-jp2_apply_pclr.patch b/third_party/libopenjpeg20/0005-jp2_apply_pclr.patch
index fd3ca634ca..c852bd057d 100644
--- a/third_party/libopenjpeg20/0005-jp2_apply_pclr.patch
+++ b/third_party/libopenjpeg20/0005-jp2_apply_pclr.patch
@@ -1,49 +1,48 @@
diff --git a/third_party/libopenjpeg20/jp2.c b/third_party/libopenjpeg20/jp2.c
-index 47f83a1..6e910a9 100644
+index 882f1b649..3ace09654 100644
--- a/third_party/libopenjpeg20/jp2.c
+++ b/third_party/libopenjpeg20/jp2.c
-@@ -902,7 +902,7 @@ static OPJ_BOOL opj_jp2_check_color(opj_image_t *image, opj_jp2_color_t *color,
- opj_event_msg(p_manager, EVT_ERROR, "Invalid component/palette index for direct mapping %d.\n", pcol);
- is_sane = OPJ_FALSE;
- }
-- else if (pcol_usage[pcol] && cmap[i].mtyp == 1) {
-+ else if (pcol_usage[pcol] && cmap[i].mtyp != 0) {
- opj_event_msg(p_manager, EVT_ERROR, "Component %d is mapped twice.\n", pcol);
- is_sane = OPJ_FALSE;
- }
-@@ -982,8 +982,8 @@ static void opj_jp2_apply_pclr(opj_image_t *image, opj_jp2_color_t *color)
- assert( pcol == 0 );
- new_comps[i] = old_comps[cmp];
- } else {
-- assert( i == pcol );
-- new_comps[pcol] = old_comps[cmp];
-+ assert( i == pcol ); // probably wrong?
-+ new_comps[i] = old_comps[cmp];
- }
+@@ -969,7 +969,7 @@ static OPJ_BOOL opj_jp2_check_color(opj_image_t *image, opj_jp2_color_t *color,
+ opj_event_msg(p_manager, EVT_ERROR,
+ "Invalid component/palette index for direct mapping %d.\n", pcol);
+ is_sane = OPJ_FALSE;
+- } else if (pcol_usage[pcol] && cmap[i].mtyp == 1) {
++ } else if (pcol_usage[pcol] && cmap[i].mtyp != 0) {
+ opj_event_msg(p_manager, EVT_ERROR, "Component %d is mapped twice.\n", pcol);
+ is_sane = OPJ_FALSE;
+ } else if (cmap[i].mtyp == 0 && cmap[i].pcol != 0) {
+@@ -1064,8 +1064,8 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
+ assert(pcol == 0);
+ new_comps[i] = old_comps[cmp];
+ } else {
+- assert(i == pcol);
+- new_comps[pcol] = old_comps[cmp];
++ assert( i == pcol ); // probably wrong?
++ new_comps[i] = old_comps[cmp];
+ }
- /* Palette mapping: */
-@@ -1007,11 +1007,11 @@ static void opj_jp2_apply_pclr(opj_image_t *image, opj_jp2_color_t *color)
- cmp = cmap[i].cmp; pcol = cmap[i].pcol;
- src = old_comps[cmp].data;
- assert( src );
-- max = new_comps[pcol].w * new_comps[pcol].h;
-+ max = new_comps[i].w * new_comps[i].h;
+ /* Palette mapping: */
+@@ -1093,19 +1093,19 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
+ pcol = cmap[i].pcol;
+ src = old_comps[cmp].data;
+ assert(src); /* verified above */
+- max = new_comps[pcol].w * new_comps[pcol].h;
++ max = new_comps[i].w * new_comps[i].h;
- /* Direct use: */
- if(cmap[i].mtyp == 0) {
-- assert( cmp == 0 );
-+ assert( cmp == 0 ); // probably wrong.
- dst = new_comps[i].data;
- assert( dst );
- for(j = 0; j < max; ++j) {
-@@ -1019,8 +1019,8 @@ static void opj_jp2_apply_pclr(opj_image_t *image, opj_jp2_color_t *color)
- }
- }
- else {
-- assert( i == pcol );
-- dst = new_comps[pcol].data;
-+ assert( i == pcol ); // probably wrong?
-+ dst = new_comps[i].data;
- assert( dst );
- for(j = 0; j < max; ++j) {
- /* The index */
+ /* Direct use: */
+ if (cmap[i].mtyp == 0) {
+- assert(cmp == 0);
++ assert( cmp == 0 ); // probably wrong.
+ dst = new_comps[i].data;
+ assert(dst);
+ for (j = 0; j < max; ++j) {
+ dst[j] = src[j];
+ }
+ } else {
+- assert(i == pcol);
+- dst = new_comps[pcol].data;
++ assert( i == pcol ); // probably wrong?
++ dst = new_comps[i].data;
+ assert(dst);
+ for (j = 0; j < max; ++j) {
+ /* The index */