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

Side by Side Diff: third_party/libopenjpeg20/pi.c

Issue 2270353002: openjpeg: Prevent an integer overflow in opj_pi_create_decode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * The copyright in this software is being made available under the 2-clauses 2 * The copyright in this software is being made available under the 2-clauses
3 * BSD License, included below. This software may be subject to other third 3 * BSD License, included below. This software may be subject to other third
4 * party and contributor rights, including patent rights, and no such rights 4 * party and contributor rights, including patent rights, and no such rights
5 * are granted under this license. 5 * are granted under this license.
6 * 6 *
7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium 7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
8 * Copyright (c) 2002-2014, Professor Benoit Macq 8 * Copyright (c) 2002-2014, Professor Benoit Macq
9 * Copyright (c) 2001-2003, David Janssens 9 * Copyright (c) 2001-2003, David Janssens
10 * Copyright (c) 2002-2003, Yannick Verschueren 10 * Copyright (c) 2002-2003, Yannick Verschueren
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 l_step_c = l_max_prec * l_step_p; 1241 l_step_c = l_max_prec * l_step_p;
1242 l_step_r = p_image->numcomps * l_step_c; 1242 l_step_r = p_image->numcomps * l_step_c;
1243 l_step_l = l_max_res * l_step_r; 1243 l_step_l = l_max_res * l_step_r;
1244 1244
1245 /* set values for first packet iterator */ 1245 /* set values for first packet iterator */
1246 l_current_pi = l_pi; 1246 l_current_pi = l_pi;
1247 1247
1248 /* memory allocation for include */ 1248 /* memory allocation for include */
1249 l_current_pi->include = 00; 1249 l_current_pi->include = 00;
1250 if 1250 if
1251 » » (l_step_l && l_tcp->numlayers < UINT_MAX / l_step_l - 1) 1251 » » (l_step_l && l_tcp->numlayers < UINT_MAX / sizeof(OPJ_INT16) / l _step_l - 1)
1252 { 1252 {
1253 l_current_pi->include = (OPJ_INT16*)opj_calloc((l_tcp->numlayers + 1) * l_step_l, sizeof(OPJ_INT16)); 1253 l_current_pi->include = (OPJ_INT16*)opj_calloc((l_tcp->numlayers + 1) * l_step_l, sizeof(OPJ_INT16));
1254 } 1254 }
1255 1255
1256 if 1256 if
1257 (!l_current_pi->include) 1257 (!l_current_pi->include)
1258 { 1258 {
1259 opj_free(l_tmp_data); 1259 opj_free(l_tmp_data);
1260 opj_free(l_tmp_ptr); 1260 opj_free(l_tmp_ptr);
1261 opj_pi_destroy(l_pi, l_bound); 1261 opj_pi_destroy(l_pi, l_bound);
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 case OPJ_PCRL: 1884 case OPJ_PCRL:
1885 return opj_pi_next_pcrl(pi); 1885 return opj_pi_next_pcrl(pi);
1886 case OPJ_CPRL: 1886 case OPJ_CPRL:
1887 return opj_pi_next_cprl(pi); 1887 return opj_pi_next_cprl(pi);
1888 case OPJ_PROG_UNKNOWN: 1888 case OPJ_PROG_UNKNOWN:
1889 return OPJ_FALSE; 1889 return OPJ_FALSE;
1890 } 1890 }
1891 1891
1892 return OPJ_FALSE; 1892 return OPJ_FALSE;
1893 } 1893 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698