From 088ca03f25fe1f6d75c0ff3b71e0ad3d018a5e0c Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Fri, 1 Sep 2017 13:25:16 -0400 Subject: 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 Reviewed-by: dsinclair --- third_party/libopenjpeg20/0006-tcd_init_tile.patch | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'third_party/libopenjpeg20/0006-tcd_init_tile.patch') diff --git a/third_party/libopenjpeg20/0006-tcd_init_tile.patch b/third_party/libopenjpeg20/0006-tcd_init_tile.patch index 6c00f4096b..967e2e4379 100644 --- a/third_party/libopenjpeg20/0006-tcd_init_tile.patch +++ b/third_party/libopenjpeg20/0006-tcd_init_tile.patch @@ -1,16 +1,16 @@ diff --git a/third_party/libopenjpeg20/tcd.c b/third_party/libopenjpeg20/tcd.c -index 2fccff1..aebe9be 100644 +index dd9faced5..f0710cd14 100644 --- a/third_party/libopenjpeg20/tcd.c +++ b/third_party/libopenjpeg20/tcd.c -@@ -727,7 +727,10 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, - l_tilec->x1 = opj_int_ceildiv(l_tile->x1, (OPJ_INT32)l_image_comp->dx); - l_tilec->y1 = opj_int_ceildiv(l_tile->y1, (OPJ_INT32)l_image_comp->dy); - /*fprintf(stderr, "\tTile compo border = %d,%d,%d,%d\n", l_tilec->x0, l_tilec->y0,l_tilec->x1,l_tilec->y1);*/ -- -+ if (l_tilec->x0 >= l_tilec->x1 || l_tilec->y0 >= l_tilec->y1) { -+ opj_event_msg(manager, EVT_ERROR, "Invalid tile data\n"); -+ return OPJ_FALSE; -+ } - /* compute l_data_size with overflow check */ - l_data_size = (OPJ_UINT32)(l_tilec->x1 - l_tilec->x0); - if ((((OPJ_UINT32)-1) / l_data_size) < (OPJ_UINT32)(l_tilec->y1 - l_tilec->y0)) { +@@ -788,7 +788,10 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, + l_tilec->x1 = opj_int_ceildiv(l_tile->x1, (OPJ_INT32)l_image_comp->dx); + l_tilec->y1 = opj_int_ceildiv(l_tile->y1, (OPJ_INT32)l_image_comp->dy); + /*fprintf(stderr, "\tTile compo border = %d,%d,%d,%d\n", l_tilec->x0, l_tilec->y0,l_tilec->x1,l_tilec->y1);*/ +- ++ if (l_tilec->x0 >= l_tilec->x1 || l_tilec->y0 >= l_tilec->y1) { ++ opj_event_msg(manager, EVT_ERROR, "Invalid tile data\n"); ++ return OPJ_FALSE; ++ } + /* compute l_data_size with overflow check */ + l_data_size = (OPJ_UINT32)(l_tilec->x1 - l_tilec->x0); + /* issue 733, l_data_size == 0U, probably something wrong should be checked before getting here */ -- cgit v1.2.3