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

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

Issue 1524553002: Merge to XFA: openjpeg: fix incrementing of "l_tcp->m_nb_mcc_records" in opj_j2k_read_mcc (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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 5323 matching lines...) Expand 10 before | Expand all | Expand 10 after
5334 { 5334 {
5335 OPJ_UINT32 i,j; 5335 OPJ_UINT32 i,j;
5336 OPJ_UINT32 l_tmp; 5336 OPJ_UINT32 l_tmp;
5337 OPJ_UINT32 l_indix; 5337 OPJ_UINT32 l_indix;
5338 opj_tcp_t * l_tcp; 5338 opj_tcp_t * l_tcp;
5339 opj_simple_mcc_decorrelation_data_t * l_mcc_record; 5339 opj_simple_mcc_decorrelation_data_t * l_mcc_record;
5340 opj_mct_data_t * l_mct_data; 5340 opj_mct_data_t * l_mct_data;
5341 OPJ_UINT32 l_nb_collections; 5341 OPJ_UINT32 l_nb_collections;
5342 OPJ_UINT32 l_nb_comps; 5342 OPJ_UINT32 l_nb_comps;
5343 OPJ_UINT32 l_nb_bytes_by_comp; 5343 OPJ_UINT32 l_nb_bytes_by_comp;
5344 OPJ_BOOL new_mcc = OPJ_FALSE;
5344 5345
5345 /* preconditions */ 5346 /* preconditions */
5346 assert(p_header_data != 00); 5347 assert(p_header_data != 00);
5347 assert(p_j2k != 00); 5348 assert(p_j2k != 00);
5348 assert(p_manager != 00); 5349 assert(p_manager != 00);
5349 5350
5350 l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ? 5351 l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?
5351 &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] : 5352 &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] :
5352 p_j2k->m_specific_param.m_decoder.m_default_tcp; 5353 p_j2k->m_specific_param.m_decoder.m_default_tcp;
5353 5354
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5395 l_tcp->m_nb_max_mcc_records = 0; 5396 l_tcp->m_nb_max_mcc_records = 0;
5396 l_tcp->m_nb_mcc_records = 0; 5397 l_tcp->m_nb_mcc_records = 0;
5397 opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read MCC marker\n"); 5398 opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read MCC marker\n");
5398 return OPJ_FALSE; 5399 return OPJ_FALSE;
5399 } 5400 }
5400 l_tcp->m_mcc_records = new_mcc_records; 5401 l_tcp->m_mcc_records = new_mcc_records;
5401 l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_re cords; 5402 l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_re cords;
5402 memset(l_mcc_record,0,(l_tcp->m_nb_max_mcc_records-l_tcp ->m_nb_mcc_records) * sizeof(opj_simple_mcc_decorrelation_data_t)); 5403 memset(l_mcc_record,0,(l_tcp->m_nb_max_mcc_records-l_tcp ->m_nb_mcc_records) * sizeof(opj_simple_mcc_decorrelation_data_t));
5403 } 5404 }
5404 l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records; 5405 l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records;
5406 new_mcc = OPJ_TRUE;
5405 } 5407 }
5406 l_mcc_record->m_index = l_indix; 5408 l_mcc_record->m_index = l_indix;
5407 5409
5408 /* only one marker atm */ 5410 /* only one marker atm */
5409 opj_read_bytes(p_header_data,&l_tmp,2); /* Ymcc */ 5411 opj_read_bytes(p_header_data,&l_tmp,2); /* Ymcc */
5410 p_header_data+=2; 5412 p_header_data+=2;
5411 if (l_tmp != 0) { 5413 if (l_tmp != 0) {
5412 opj_event_msg(p_manager, EVT_WARNING, "Cannot take in charge mul tiple data spanning\n"); 5414 opj_event_msg(p_manager, EVT_WARNING, "Cannot take in charge mul tiple data spanning\n");
5413 return OPJ_TRUE; 5415 return OPJ_TRUE;
5414 } 5416 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
5530 return OPJ_FALSE; 5532 return OPJ_FALSE;
5531 } 5533 }
5532 } 5534 }
5533 } 5535 }
5534 5536
5535 if (p_header_size != 0) { 5537 if (p_header_size != 0) {
5536 opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n" ); 5538 opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n" );
5537 return OPJ_FALSE; 5539 return OPJ_FALSE;
5538 } 5540 }
5539 5541
5540 ++l_tcp->m_nb_mcc_records; 5542 if (new_mcc) {
5543 ++l_tcp->m_nb_mcc_records;
5544 }
5541 5545
5542 return OPJ_TRUE; 5546 return OPJ_TRUE;
5543 } 5547 }
5544 5548
5545 static OPJ_BOOL opj_j2k_write_mco( opj_j2k_t *p_j2k, 5549 static OPJ_BOOL opj_j2k_write_mco( opj_j2k_t *p_j2k,
5546 struct opj_stream_private *p_str eam, 5550 struct opj_stream_private *p_str eam,
5547 struct opj_event_mgr * p_manager 5551 struct opj_event_mgr * p_manager
5548 ) 5552 )
5549 { 5553 {
5550 OPJ_BYTE * l_current_data = 00; 5554 OPJ_BYTE * l_current_data = 00;
(...skipping 5249 matching lines...) Expand 10 before | Expand all | Expand 10 after
10800 return OPJ_FALSE; 10804 return OPJ_FALSE;
10801 } 10805 }
10802 if (! opj_j2k_post_write_tile(p_j2k,p_stream,p_manager)) { 10806 if (! opj_j2k_post_write_tile(p_j2k,p_stream,p_manager)) {
10803 opj_event_msg(p_manager, EVT_ERROR, "Error while opj_j2k _post_write_tile with tile index = %d\n", p_tile_index); 10807 opj_event_msg(p_manager, EVT_ERROR, "Error while opj_j2k _post_write_tile with tile index = %d\n", p_tile_index);
10804 return OPJ_FALSE; 10808 return OPJ_FALSE;
10805 } 10809 }
10806 } 10810 }
10807 10811
10808 return OPJ_TRUE; 10812 return OPJ_TRUE;
10809 } 10813 }
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