summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/0014-opj_jp2_read_ihdr_leak.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/0014-opj_jp2_read_ihdr_leak.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/0014-opj_jp2_read_ihdr_leak.patch')
-rw-r--r--third_party/libopenjpeg20/0014-opj_jp2_read_ihdr_leak.patch36
1 files changed, 14 insertions, 22 deletions
diff --git a/third_party/libopenjpeg20/0014-opj_jp2_read_ihdr_leak.patch b/third_party/libopenjpeg20/0014-opj_jp2_read_ihdr_leak.patch
index f5645330a3..0ae0cfcb1b 100644
--- a/third_party/libopenjpeg20/0014-opj_jp2_read_ihdr_leak.patch
+++ b/third_party/libopenjpeg20/0014-opj_jp2_read_ihdr_leak.patch
@@ -1,28 +1,20 @@
diff --git a/third_party/libopenjpeg20/jp2.c b/third_party/libopenjpeg20/jp2.c
-index 3bcb42e..a6648f6 100644
+index 7ef7c9139..1fa607d66 100644
--- a/third_party/libopenjpeg20/jp2.c
+++ b/third_party/libopenjpeg20/jp2.c
-@@ -561,6 +561,7 @@ static OPJ_BOOL opj_jp2_read_ihdr( opj_jp2_t *jp2,
- p_image_header_data += 2;
+@@ -593,6 +593,7 @@ static OPJ_BOOL opj_jp2_read_ihdr(opj_jp2_t *jp2,
+ }
- /* allocate memory for components */
-+ opj_free(jp2->comps);
- jp2->comps = (opj_jp2_comps_t*) opj_calloc(jp2->numcomps, sizeof(opj_jp2_comps_t));
- if (jp2->comps == 0) {
- opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to handle image header (ihdr)\n");
-@@ -1758,6 +1759,7 @@ void opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters)
+ /* allocate memory for components */
++ opj_free(jp2->comps);
+ jp2->comps = (opj_jp2_comps_t*) opj_calloc(jp2->numcomps,
+ sizeof(opj_jp2_comps_t));
+ if (jp2->comps == 0) {
+@@ -1882,6 +1883,7 @@ void opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters)
- /* further JP2 initializations go here */
- jp2->color.jp2_has_colr = 0;
-+ jp2->comps = NULL;
- jp2->ignore_pclr_cmap_cdef = parameters->flags & OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
+ /* further JP2 initializations go here */
+ jp2->color.jp2_has_colr = 0;
++ jp2->comps = NULL;
+ jp2->ignore_pclr_cmap_cdef = parameters->flags &
+ OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
}
-
-@@ -1815,7 +1817,6 @@ OPJ_BOOL opj_jp2_setup_encoder( opj_jp2_t *jp2,
- jp2->numcomps = image->numcomps; /* NC */
- jp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));
- if (!jp2->comps) {
-- jp2->comps = NULL;
- opj_event_msg(p_manager, EVT_ERROR, "Not enough memory when setup the JP2 encoder\n");
- /* Memory of jp2->cl will be freed by opj_jp2_destroy */
- return OPJ_FALSE;