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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp

Issue 818363006: fix a few linux compilation warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 11 months 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
OLDNEW
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>
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 check *= BitsPerComponent; 231 check *= BitsPerComponent;
232 if (check > INT_MAX - 7) { 232 if (check > INT_MAX - 7) {
233 return FALSE; 233 return FALSE;
234 } 234 }
235 return TRUE; 235 return TRUE;
236 } 236 }
237 ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, 237 ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
238 int nComps, int bpc, const CPDF_Dictionary* pParams) 238 int nComps, int bpc, const CPDF_Dictionary* pParams)
239 { 239 {
240 int predictor = 0; 240 int predictor = 0;
241 // TODO(tsepez): bEarlyChange not use, also BPC vs. bits per component?
jun_fang 2015/01/16 22:07:58 We think that bEarlyChange can be removed. The his
241 FX_BOOL bEarlyChange = TRUE; 242 FX_BOOL bEarlyChange = TRUE;
242 int Colors = 0, BitsPerComponent = 0, Columns = 0; 243 int Colors = 0, BitsPerComponent = 0, Columns = 0;
243 if (pParams) { 244 if (pParams) {
244 predictor = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("Predictor" )); 245 predictor = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("Predictor" ));
245 bEarlyChange = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("EarlyCh ange"), 1); 246 bEarlyChange = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("EarlyCh ange"), 1);
246 Colors = pParams->GetInteger(FX_BSTRC("Colors"), 1); 247 Colors = pParams->GetInteger(FX_BSTRC("Colors"), 1);
247 BitsPerComponent = pParams->GetInteger(FX_BSTRC("BitsPerComponent"), 8); 248 BitsPerComponent = pParams->GetInteger(FX_BSTRC("BitsPerComponent"), 8);
248 Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1); 249 Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1);
249 if (!CheckFlateDecodeParams(Colors, BitsPerComponent, Columns)) { 250 if (!CheckFlateDecodeParams(Colors, BitsPerComponent, Columns)) {
250 return NULL; 251 return NULL;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 532 }
532 } 533 }
533 FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_ buf, FX_DWORD& dest_size) 534 FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_ buf, FX_DWORD& dest_size)
534 { 535 {
535 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule(); 536 CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
536 if (pEncoders) { 537 if (pEncoders) {
537 return pEncoders->GetFlateModule()->FlateOrLZWDecode(FALSE, src_buf, src _size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size); 538 return pEncoders->GetFlateModule()->FlateOrLZWDecode(FALSE, src_buf, src _size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size);
538 } 539 }
539 return 0; 540 return 0;
540 } 541 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698