Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: third_party/libopenjpeg20/0009-opj_pi_next.patch

Issue 1590593002: Merge to XFA: openjpeg: Fix potential bad precno value in opj_pi_next* functions. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/libopenjpeg20/README.pdfium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff --git a/third_party/libopenjpeg20/pi.c b/third_party/libopenjpeg20/pi.c
2 index 06f1e41..462e07c 100644
3 --- a/third_party/libopenjpeg20/pi.c
4 +++ b/third_party/libopenjpeg20/pi.c
5 @@ -377,6 +377,9 @@ if (!pi->tp_on){
6 prcj = opj_int_floordivpow2(opj_int_ceil div(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)
7 - opj_int_floordivpow2(try0, (O PJ_INT32)res->pdy);
8 pi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);
9 + if (pi->precno >= res->pw * res->ph) {
10 + return OPJ_FALSE;
11 + }
12 for (pi->layno = pi->poc.layno0; pi->lay no < pi->poc.layno1; pi->layno++) {
13 index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
14 if (!pi->include[index]) {
15 @@ -458,6 +461,9 @@ static OPJ_BOOL opj_pi_next_pcrl(opj_pi_iterator_t * pi) {
16 prcj = opj_int_floordivpow2(opj_int_ceil div(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)
17 - opj_int_floordivpow2(try0, (O PJ_INT32)res->pdy);
18 pi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);
19 + if (pi->precno >= res->pw * res->ph) {
20 + return OPJ_FALSE;
21 + }
22 for (pi->layno = pi->poc.layno0; pi->lay no < pi->poc.layno1; pi->layno++) {
23 index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
24 if (!pi->include[index]) {
25 @@ -537,6 +543,9 @@ static OPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi) {
26 prcj = opj_int_floordivpow2(opj_int_ceil div(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)
27 - opj_int_floordivpow2(try0, (O PJ_INT32)res->pdy);
28 pi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);
29 + if (pi->precno >= res->pw * res->ph) {
30 + return OPJ_FALSE;
31 + }
32 for (pi->layno = pi->poc.layno0; pi->lay no < pi->poc.layno1; pi->layno++) {
33 index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
34 if (!pi->include[index]) {
OLDNEW
« no previous file with comments | « no previous file | third_party/libopenjpeg20/README.pdfium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698