diff options
author | Nicolas Pena <npm@chromium.org> | 2017-10-23 10:30:46 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-23 22:40:23 +0000 |
commit | 826480cf599f61fe0366ab2bd5803dd53c9d0562 (patch) | |
tree | d42bca4255a2ecf484b8498b08c6132dbcffe86a /third_party/libopenjpeg20/0006-tcd_init_tile.patch | |
parent | ebdba614b9683ddd1d50e8960639bc54c9d4bb7a (diff) | |
download | pdfium-826480cf599f61fe0366ab2bd5803dd53c9d0562.tar.xz |
Upgrade LibopenJPEG to 2.3chromium/3249
Bug:
Change-Id: I4c968a4e5f41037d80e5dc64a1297cd2cbda31b1
Reviewed-on: https://pdfium-review.googlesource.com/16350
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'third_party/libopenjpeg20/0006-tcd_init_tile.patch')
-rw-r--r-- | third_party/libopenjpeg20/0006-tcd_init_tile.patch | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/third_party/libopenjpeg20/0006-tcd_init_tile.patch b/third_party/libopenjpeg20/0006-tcd_init_tile.patch index 967e2e4379..8c37fc2733 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 dd9faced5..f0710cd14 100644 +index 1dd15405d..acc28dd55 100644 --- a/third_party/libopenjpeg20/tcd.c +++ b/third_party/libopenjpeg20/tcd.c -@@ -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 */ +@@ -818,6 +818,11 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, + if (isEncoder) { + OPJ_SIZE_T l_tile_data_size; + ++ 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 */ + OPJ_SIZE_T w = (OPJ_SIZE_T)(l_tilec->x1 - l_tilec->x0); + OPJ_SIZE_T h = (OPJ_SIZE_T)(l_tilec->y1 - l_tilec->y0); |