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

Side by Side Diff: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/jp2.c

Issue 624023003: check pointer overflow in t2.c (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 2 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 | core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/t2.c » ('j') | 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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 { 1273 {
1274 opj_read_bytes(p_colr_header_data,&l_value,1); /* icc values */ 1274 opj_read_bytes(p_colr_header_data,&l_value,1); /* icc values */
1275 ++p_colr_header_data; 1275 ++p_colr_header_data;
1276 jp2->color.icc_profile_buf[it_icc_value] = (OPJ_BYTE) l_ value; 1276 jp2->color.icc_profile_buf[it_icc_value] = (OPJ_BYTE) l_ value;
1277 } 1277 }
1278 1278
1279 jp2->color.jp2_has_colr = 1; 1279 jp2->color.jp2_has_colr = 1;
1280 } 1280 }
1281 else if (jp2->meth > 2) 1281 else if (jp2->meth > 2)
1282 { 1282 {
1283 /*» ISO/IEC 15444-1:2004 (E), Table I.9 ­ Legal METH values: 1283 /*» ISO/IEC 15444-1:2004 (E), Table I.9 Legal METH values:
Tom Sepez 2014/10/03 18:41:10 nit: looks to be an unintended whitespace only cha
Bo Xu 2014/10/03 19:08:38 I got the warning of "the file contains a characte
1284 conforming JP2 reader shall ignore the entire Colour Specification box.* / 1284 conforming JP2 reader shall ignore the entire Colour Specification box.* /
1285 opj_event_msg(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), " 1285 opj_event_msg(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), "
1286 "so we will ignore the entire Colour Specification box. \n", jp2->me th); 1286 "so we will ignore the entire Colour Specification box. \n", jp2->me th);
1287 } 1287 }
1288 return OPJ_TRUE; 1288 return OPJ_TRUE;
1289 } 1289 }
1290 1290
1291 OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2, 1291 OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2,
1292 opj_stream_private_t *p_stream, 1292 opj_stream_private_t *p_stream,
1293 opj_image_t* p_image, 1293 opj_image_t* p_image,
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
2779 len = opj_stream_tell(cio)-lenp; 2779 len = opj_stream_tell(cio)-lenp;
2780 opj_stream_skip(cio, lenp, p_manager); 2780 opj_stream_skip(cio, lenp, p_manager);
2781 opj_write_bytes(l_data_header,len,4);/* L */ 2781 opj_write_bytes(l_data_header,len,4);/* L */
2782 opj_stream_write_data(cio,l_data_header,4,p_manager); 2782 opj_stream_write_data(cio,l_data_header,4,p_manager);
2783 opj_stream_seek(cio, lenp+len,p_manager); 2783 opj_stream_seek(cio, lenp+len,p_manager);
2784 2784
2785 return len; 2785 return len;
2786 } 2786 }
2787 #endif 2787 #endif
2788 #endif /* USE_JPIP */ 2788 #endif /* USE_JPIP */
OLDNEW
« no previous file with comments | « no previous file | core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/t2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698