OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" | 7 #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" |
8 | 8 |
9 #include <limits.h> | 9 #include <limits.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <utility> | 12 #include <utility> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "core/fpdfapi/cpdf_modulemgr.h" | 15 #include "core/fpdfapi/cpdf_modulemgr.h" |
16 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" | 16 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" |
17 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" | 17 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" |
18 #include "core/fpdfapi/fpdf_parser/fpdf_parser_utility.h" | 18 #include "core/fpdfapi/fpdf_parser/fpdf_parser_utility.h" |
19 #include "core/fxcodec/fx_codec.h" | 19 #include "core/fxcodec/fx_codec.h" |
20 #include "core/fxcrt/include/fx_ext.h" | 20 #include "core/fxcrt/fx_ext.h" |
21 #include "third_party/base/stl_util.h" | 21 #include "third_party/base/stl_util.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 const uint32_t kMaxStreamSize = 20 * 1024 * 1024; | 25 const uint32_t kMaxStreamSize = 20 * 1024 * 1024; |
26 | 26 |
27 bool CheckFlateDecodeParams(int Colors, int BitsPerComponent, int Columns) { | 27 bool CheckFlateDecodeParams(int Colors, int BitsPerComponent, int Columns) { |
28 if (Colors < 0 || BitsPerComponent < 0 || Columns < 0) | 28 if (Colors < 0 || BitsPerComponent < 0 || Columns < 0) |
29 return false; | 29 return false; |
30 | 30 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 uint32_t src_size, | 566 uint32_t src_size, |
567 uint8_t*& dest_buf, | 567 uint8_t*& dest_buf, |
568 uint32_t& dest_size) { | 568 uint32_t& dest_size) { |
569 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); | 569 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); |
570 if (pEncoders) { | 570 if (pEncoders) { |
571 return pEncoders->GetFlateModule()->FlateOrLZWDecode( | 571 return pEncoders->GetFlateModule()->FlateOrLZWDecode( |
572 FALSE, src_buf, src_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size); | 572 FALSE, src_buf, src_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size); |
573 } | 573 } |
574 return 0; | 574 return 0; |
575 } | 575 } |
OLD | NEW |