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 <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include "core/include/fpdfapi/fpdf_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
10 #include "core/include/fpdfapi/fpdf_parser.h" | 10 #include "core/include/fpdfapi/fpdf_parser.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 BitsPerComponent, Columns, estimated_size, dest_buf, dest_size); | 317 BitsPerComponent, Columns, estimated_size, dest_buf, dest_size); |
318 } | 318 } |
319 FX_BOOL PDF_DataDecode(const uint8_t* src_buf, | 319 FX_BOOL PDF_DataDecode(const uint8_t* src_buf, |
320 FX_DWORD src_size, | 320 FX_DWORD src_size, |
321 const CPDF_Dictionary* pDict, | 321 const CPDF_Dictionary* pDict, |
322 uint8_t*& dest_buf, | 322 uint8_t*& dest_buf, |
323 FX_DWORD& dest_size, | 323 FX_DWORD& dest_size, |
324 CFX_ByteString& ImageEncoding, | 324 CFX_ByteString& ImageEncoding, |
325 CPDF_Dictionary*& pImageParms, | 325 CPDF_Dictionary*& pImageParms, |
326 FX_DWORD last_estimated_size, | 326 FX_DWORD last_estimated_size, |
327 FX_BOOL bImageAcc) | 327 FX_BOOL bImageAcc) { |
328 | |
329 { | |
330 CPDF_Object* pDecoder = pDict ? pDict->GetElementValue("Filter") : nullptr; | 328 CPDF_Object* pDecoder = pDict ? pDict->GetElementValue("Filter") : nullptr; |
331 if (!pDecoder || (!pDecoder->IsArray() && !pDecoder->IsName())) | 329 if (!pDecoder || (!pDecoder->IsArray() && !pDecoder->IsName())) |
332 return FALSE; | 330 return FALSE; |
333 | 331 |
334 CPDF_Object* pParams = | 332 CPDF_Object* pParams = |
335 pDict ? pDict->GetElementValue("DecodeParms") : nullptr; | 333 pDict ? pDict->GetElementValue("DecodeParms") : nullptr; |
336 CFX_ByteStringArray DecoderList; | 334 CFX_ByteStringArray DecoderList; |
337 CFX_ArrayTemplate<CPDF_Object*> ParamList; | 335 CFX_ArrayTemplate<CPDF_Object*> ParamList; |
338 if (CPDF_Array* pDecoders = pDecoder->AsArray()) { | 336 if (CPDF_Array* pDecoders = pDecoder->AsArray()) { |
339 CPDF_Array* pParamsArray = ToArray(pParams); | 337 CPDF_Array* pParamsArray = ToArray(pParams); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 FX_DWORD src_size, | 566 FX_DWORD src_size, |
569 uint8_t*& dest_buf, | 567 uint8_t*& dest_buf, |
570 FX_DWORD& dest_size) { | 568 FX_DWORD& dest_size) { |
571 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); | 569 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); |
572 if (pEncoders) { | 570 if (pEncoders) { |
573 return pEncoders->GetFlateModule()->FlateOrLZWDecode( | 571 return pEncoders->GetFlateModule()->FlateOrLZWDecode( |
574 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); |
575 } | 573 } |
576 return 0; | 574 return 0; |
577 } | 575 } |
OLD | NEW |