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 "../../../include/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
10 #include <limits.h> | 10 #include <limits.h> |
11 #define _STREAM_MAX_SIZE_ 20 * 1024 * 1024 | 11 #define _STREAM_MAX_SIZE_ 20 * 1024 * 1024 |
12 FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b
uf, FX_DWORD& dest_size) | 12 FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b
uf, FX_DWORD& dest_size) |
13 { | 13 { |
14 dest_size = 0; | 14 dest_size = 0; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 return ret; | 192 return ret; |
193 } | 193 } |
194 ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD sr
c_size, int width, int height, | 194 ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD sr
c_size, int width, int height, |
195 const CPDF_Dictionary* pParams) | 195 const CPDF_Dictionary* pParams) |
196 { | 196 { |
197 int K = 0; | 197 int K = 0; |
198 FX_BOOL EndOfLine = FALSE; | 198 FX_BOOL EndOfLine = FALSE; |
199 FX_BOOL ByteAlign = FALSE; | 199 FX_BOOL ByteAlign = FALSE; |
200 FX_BOOL BlackIs1 = FALSE; | 200 FX_BOOL BlackIs1 = FALSE; |
201 FX_BOOL Columns = 1728; | 201 int Columns = 1728; |
202 FX_BOOL Rows = 0; | 202 int Rows = 0; |
203 if (pParams) { | 203 if (pParams) { |
204 K = pParams->GetInteger(FX_BSTRC("K")); | 204 K = pParams->GetInteger(FX_BSTRC("K")); |
205 EndOfLine = pParams->GetInteger(FX_BSTRC("EndOfLine")); | 205 EndOfLine = pParams->GetInteger(FX_BSTRC("EndOfLine")); |
206 ByteAlign = pParams->GetInteger(FX_BSTRC("EncodedByteAlign")); | 206 ByteAlign = pParams->GetInteger(FX_BSTRC("EncodedByteAlign")); |
207 BlackIs1 = pParams->GetInteger(FX_BSTRC("BlackIs1")); | 207 BlackIs1 = pParams->GetInteger(FX_BSTRC("BlackIs1")); |
208 Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1728); | 208 Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1728); |
209 Rows = pParams->GetInteger(FX_BSTRC("Rows")); | 209 Rows = pParams->GetInteger(FX_BSTRC("Rows")); |
210 if (Rows > USHRT_MAX) { | 210 if (Rows > USHRT_MAX) { |
211 Rows = 0; | 211 Rows = 0; |
212 } | 212 } |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 } | 525 } |
526 } | 526 } |
527 FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_
buf, FX_DWORD& dest_size) | 527 FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_
buf, FX_DWORD& dest_size) |
528 { | 528 { |
529 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); | 529 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); |
530 if (pEncoders) { | 530 if (pEncoders) { |
531 return pEncoders->GetFlateModule()->FlateOrLZWDecode(FALSE, src_buf, src
_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size); | 531 return pEncoders->GetFlateModule()->FlateOrLZWDecode(FALSE, src_buf, src
_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size); |
532 } | 532 } |
533 return 0; | 533 return 0; |
534 } | 534 } |
OLD | NEW |