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

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

Issue 2182683002: Fix an integer overflow in opj_tcd_get_decoded_tile_size(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: another Created 4 years, 5 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
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 8010 matching lines...) Expand 10 before | Expand all | Expand 10 after
8021 opj_event_msg(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n"); 8021 opj_event_msg(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n");
8022 return OPJ_FALSE; 8022 return OPJ_FALSE;
8023 } 8023 }
8024 8024
8025 opj_event_msg(p_manager, EVT_INFO, "Header of tile %d / %d has been read .\n", 8025 opj_event_msg(p_manager, EVT_INFO, "Header of tile %d / %d has been read .\n",
8026 p_j2k->m_current_tile_number+1, (p_j2k->m_cp.th * p_j2k- >m_cp.tw)); 8026 p_j2k->m_current_tile_number+1, (p_j2k->m_cp.th * p_j2k- >m_cp.tw));
8027 8027
8028 *p_tile_index = p_j2k->m_current_tile_number; 8028 *p_tile_index = p_j2k->m_current_tile_number;
8029 *p_go_on = OPJ_TRUE; 8029 *p_go_on = OPJ_TRUE;
8030 *p_data_size = opj_tcd_get_decoded_tile_size(p_j2k->m_tcd); 8030 *p_data_size = opj_tcd_get_decoded_tile_size(p_j2k->m_tcd);
8031 if (*p_data_size == (OPJ_UINT32)-1) {
8032 return OPJ_FALSE;
8033 }
8034
8031 *p_tile_x0 = p_j2k->m_tcd->tcd_image->tiles->x0; 8035 *p_tile_x0 = p_j2k->m_tcd->tcd_image->tiles->x0;
8032 *p_tile_y0 = p_j2k->m_tcd->tcd_image->tiles->y0; 8036 *p_tile_y0 = p_j2k->m_tcd->tcd_image->tiles->y0;
8033 *p_tile_x1 = p_j2k->m_tcd->tcd_image->tiles->x1; 8037 *p_tile_x1 = p_j2k->m_tcd->tcd_image->tiles->x1;
8034 *p_tile_y1 = p_j2k->m_tcd->tcd_image->tiles->y1; 8038 *p_tile_y1 = p_j2k->m_tcd->tcd_image->tiles->y1;
8035 *p_nb_comps = p_j2k->m_tcd->tcd_image->tiles->numcomps; 8039 *p_nb_comps = p_j2k->m_tcd->tcd_image->tiles->numcomps;
8036 8040
8037 p_j2k->m_specific_param.m_decoder.m_state |= 0x0080;/* FIXME J2K_DEC_ST ATE_DATA;*/ 8041 p_j2k->m_specific_param.m_decoder.m_state |= 0x0080;/* FIXME J2K_DEC_ST ATE_DATA;*/
8038 8042
8039 return OPJ_TRUE; 8043 return OPJ_TRUE;
8040 } 8044 }
(...skipping 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after
10814 return OPJ_FALSE; 10818 return OPJ_FALSE;
10815 } 10819 }
10816 if (! opj_j2k_post_write_tile(p_j2k,p_stream,p_manager)) { 10820 if (! opj_j2k_post_write_tile(p_j2k,p_stream,p_manager)) {
10817 opj_event_msg(p_manager, EVT_ERROR, "Error while opj_j2k _post_write_tile with tile index = %d\n", p_tile_index); 10821 opj_event_msg(p_manager, EVT_ERROR, "Error while opj_j2k _post_write_tile with tile index = %d\n", p_tile_index);
10818 return OPJ_FALSE; 10822 return OPJ_FALSE;
10819 } 10823 }
10820 } 10824 }
10821 10825
10822 return OPJ_TRUE; 10826 return OPJ_TRUE;
10823 } 10827 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698