blob: d6995a745ba13fd420ab3bd35f4366eb5f867258 [file] [log] [blame]
Lei Zhangb8c253a2022-06-10 22:17:42 +00001diff --git a/third_party/libopenjpeg/tcd.c b/third_party/libopenjpeg/tcd.c
Daniel Hosseiniana81ff722021-02-17 20:56:08 +00002index 4c728d4c6..b9f571410 100644
Lei Zhangb8c253a2022-06-10 22:17:42 +00003--- a/third_party/libopenjpeg/tcd.c
4+++ b/third_party/libopenjpeg/tcd.c
Daniel Hosseiniana81ff722021-02-17 20:56:08 +00005@@ -1094,6 +1094,9 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
Nicolas Pena088ca032017-09-01 13:25:16 -04006 l_current_precinct->ch = (OPJ_UINT32)((brcblkyend - tlcblkystart) >>
7 cblkheightexpn);
Lei Zhang3dd6ef02019-07-03 18:40:49 +00008
Nicolas Pena088ca032017-09-01 13:25:16 -04009+ if (l_current_precinct->cw && ((OPJ_UINT32)-1) / l_current_precinct->cw < l_current_precinct->ch) {
10+ return OPJ_FALSE;
11+ }
12 l_nb_code_blocks = l_current_precinct->cw * l_current_precinct->ch;
13 /*fprintf(stderr, "\t\t\t\t precinct_cw = %d x recinct_ch = %d\n",l_current_precinct->cw, l_current_precinct->ch); */
Lei Zhang3dd6ef02019-07-03 18:40:49 +000014 if ((((OPJ_UINT32) - 1) / (OPJ_UINT32)sizeof_block) <