Lei Zhang | b8c253a | 2022-06-10 22:17:42 +0000 | [diff] [blame] | 1 | diff --git a/third_party/libopenjpeg/tcd.c b/third_party/libopenjpeg/tcd.c |
Daniel Hosseinian | a81ff72 | 2021-02-17 20:56:08 +0000 | [diff] [blame] | 2 | index 4c728d4c6..b9f571410 100644 |
Lei Zhang | b8c253a | 2022-06-10 22:17:42 +0000 | [diff] [blame] | 3 | --- a/third_party/libopenjpeg/tcd.c |
| 4 | +++ b/third_party/libopenjpeg/tcd.c |
Daniel Hosseinian | a81ff72 | 2021-02-17 20:56:08 +0000 | [diff] [blame] | 5 | @@ -1094,6 +1094,9 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, |
Nicolas Pena | 088ca03 | 2017-09-01 13:25:16 -0400 | [diff] [blame] | 6 | l_current_precinct->ch = (OPJ_UINT32)((brcblkyend - tlcblkystart) >> |
| 7 | cblkheightexpn); |
Lei Zhang | 3dd6ef0 | 2019-07-03 18:40:49 +0000 | [diff] [blame] | 8 | |
Nicolas Pena | 088ca03 | 2017-09-01 13:25:16 -0400 | [diff] [blame] | 9 | + 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 Zhang | 3dd6ef0 | 2019-07-03 18:40:49 +0000 | [diff] [blame] | 14 | if ((((OPJ_UINT32) - 1) / (OPJ_UINT32)sizeof_block) < |