| 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 #include "../../../include/fpdfapi/fpdf_parser.h" | 8 #include "../../../include/fpdfapi/fpdf_parser.h" |
| 9 #include "../../../include/fpdfapi/fpdf_module.h" | 9 #include "../../../include/fpdfapi/fpdf_module.h" |
| 10 #include "../../../include/fxcodec/fx_codec.h" | 10 #include "../../../include/fxcodec/fx_codec.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 uint8_t*& dest_buf, | 325 uint8_t*& dest_buf, |
| 326 FX_DWORD& dest_size, | 326 FX_DWORD& dest_size, |
| 327 CFX_ByteString& ImageEncoding, | 327 CFX_ByteString& ImageEncoding, |
| 328 CPDF_Dictionary*& pImageParms, | 328 CPDF_Dictionary*& pImageParms, |
| 329 FX_DWORD last_estimated_size, | 329 FX_DWORD last_estimated_size, |
| 330 FX_BOOL bImageAcc) | 330 FX_BOOL bImageAcc) |
| 331 | 331 |
| 332 { | 332 { |
| 333 CPDF_Object* pDecoder = | 333 CPDF_Object* pDecoder = |
| 334 pDict ? pDict->GetElementValue(FX_BSTRC("Filter")) : NULL; | 334 pDict ? pDict->GetElementValue(FX_BSTRC("Filter")) : NULL; |
| 335 if (pDecoder == NULL || (pDecoder->GetType() != PDFOBJ_ARRAY && | 335 if (!pDecoder || (pDecoder->GetType() != PDFOBJ_ARRAY && !pDecoder->IsName())) |
| 336 pDecoder->GetType() != PDFOBJ_NAME)) { | |
| 337 return FALSE; | 336 return FALSE; |
| 338 } | 337 |
| 339 CPDF_Object* pParams = | 338 CPDF_Object* pParams = |
| 340 pDict ? pDict->GetElementValue(FX_BSTRC("DecodeParms")) : NULL; | 339 pDict ? pDict->GetElementValue(FX_BSTRC("DecodeParms")) : NULL; |
| 341 CFX_ByteStringArray DecoderList; | 340 CFX_ByteStringArray DecoderList; |
| 342 CFX_PtrArray ParamList; | 341 CFX_PtrArray ParamList; |
| 343 if (pDecoder->GetType() == PDFOBJ_ARRAY) { | 342 if (pDecoder->GetType() == PDFOBJ_ARRAY) { |
| 344 if (pParams && pParams->GetType() != PDFOBJ_ARRAY) { | 343 if (pParams && pParams->GetType() != PDFOBJ_ARRAY) { |
| 345 pParams = NULL; | 344 pParams = NULL; |
| 346 } | 345 } |
| 347 CPDF_Array* pDecoders = (CPDF_Array*)pDecoder; | 346 CPDF_Array* pDecoders = (CPDF_Array*)pDecoder; |
| 348 for (FX_DWORD i = 0; i < pDecoders->GetCount(); i++) { | 347 for (FX_DWORD i = 0; i < pDecoders->GetCount(); i++) { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 FX_DWORD src_size, | 577 FX_DWORD src_size, |
| 579 uint8_t*& dest_buf, | 578 uint8_t*& dest_buf, |
| 580 FX_DWORD& dest_size) { | 579 FX_DWORD& dest_size) { |
| 581 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); | 580 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); |
| 582 if (pEncoders) { | 581 if (pEncoders) { |
| 583 return pEncoders->GetFlateModule()->FlateOrLZWDecode( | 582 return pEncoders->GetFlateModule()->FlateOrLZWDecode( |
| 584 FALSE, src_buf, src_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size); | 583 FALSE, src_buf, src_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size); |
| 585 } | 584 } |
| 586 return 0; | 585 return 0; |
| 587 } | 586 } |
| OLD | NEW |