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

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

Issue 2071773002: openjpeg: Prevent a buffer overflow in opj_j2k_read_SQcd_SQcc. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: update README.pdfium for libopenjpeg20 Created 4 years, 6 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 | « third_party/libopenjpeg20/README.pdfium ('k') | 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 8992 matching lines...) Expand 10 before | Expand all | Expand 10 after
9003 assert(p_manager != 00); 9003 assert(p_manager != 00);
9004 assert(p_header_data != 00); 9004 assert(p_header_data != 00);
9005 9005
9006 l_cp = &(p_j2k->m_cp); 9006 l_cp = &(p_j2k->m_cp);
9007 /* come from tile part header or main header ?*/ 9007 /* come from tile part header or main header ?*/
9008 l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ? / *FIXME J2K_DEC_STATE_TPH*/ 9008 l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ? / *FIXME J2K_DEC_STATE_TPH*/
9009 &l_cp->tcps[p_j2k->m_current_tile_number] : 9009 &l_cp->tcps[p_j2k->m_current_tile_number] :
9010 p_j2k->m_specific_param.m_decoder.m_default_tcp; 9010 p_j2k->m_specific_param.m_decoder.m_default_tcp;
9011 9011
9012 /* precondition again*/ 9012 /* precondition again*/
9013 assert(p_comp_no < p_j2k->m_private_image->numcomps); 9013 if (p_comp_no >= p_j2k->m_private_image->numcomps) {
9014 return OPJ_FALSE;
9015 }
9014 9016
9015 l_tccp = &l_tcp->tccps[p_comp_no]; 9017 l_tccp = &l_tcp->tccps[p_comp_no];
9016 l_current_ptr = p_header_data; 9018 l_current_ptr = p_header_data;
9017 9019
9018 if (*p_header_size < 1) { 9020 if (*p_header_size < 1) {
9019 opj_event_msg(p_manager, EVT_ERROR, "Error reading SQcd or SQcc element\n"); 9021 opj_event_msg(p_manager, EVT_ERROR, "Error reading SQcd or SQcc element\n");
9020 return OPJ_FALSE; 9022 return OPJ_FALSE;
9021 } 9023 }
9022 *p_header_size -= 1; 9024 *p_header_size -= 1;
9023 9025
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
10812 return OPJ_FALSE; 10814 return OPJ_FALSE;
10813 } 10815 }
10814 if (! opj_j2k_post_write_tile(p_j2k,p_stream,p_manager)) { 10816 if (! opj_j2k_post_write_tile(p_j2k,p_stream,p_manager)) {
10815 opj_event_msg(p_manager, EVT_ERROR, "Error while opj_j2k _post_write_tile with tile index = %d\n", p_tile_index); 10817 opj_event_msg(p_manager, EVT_ERROR, "Error while opj_j2k _post_write_tile with tile index = %d\n", p_tile_index);
10816 return OPJ_FALSE; 10818 return OPJ_FALSE;
10817 } 10819 }
10818 } 10820 }
10819 10821
10820 return OPJ_TRUE; 10822 return OPJ_TRUE;
10821 } 10823 }
OLDNEW
« no previous file with comments | « third_party/libopenjpeg20/README.pdfium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698