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

Side by Side Diff: core/fxcodec/codec/fx_codec_progress.cpp

Issue 2085493002: Fixup LoadImageInfo type checking. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/fxcodec/codec/include/ccodec_progressivedecoder.h" 7 #include "core/fxcodec/codec/include/ccodec_progressivedecoder.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 return m_status; 1315 return m_status;
1316 } 1316 }
1317 m_pFile = pFile; 1317 m_pFile = pFile;
1318 m_offSet = 0; 1318 m_offSet = 0;
1319 m_SrcWidth = m_SrcHeight = 0; 1319 m_SrcWidth = m_SrcHeight = 0;
1320 m_SrcComponents = m_SrcBPC = 0; 1320 m_SrcComponents = m_SrcBPC = 0;
1321 m_clipBox = FX_RECT(0, 0, 0, 0); 1321 m_clipBox = FX_RECT(0, 0, 0, 0);
1322 m_startX = m_startY = 0; 1322 m_startX = m_startY = 0;
1323 m_sizeX = m_sizeY = 0; 1323 m_sizeX = m_sizeY = 0;
1324 m_SrcPassNumber = 0; 1324 m_SrcPassNumber = 0;
1325 if (bSkipImageTypeCheck || (imageType != FXCODEC_IMAGE_UNKNOWN && 1325 if (imageType != FXCODEC_IMAGE_UNKNOWN &&
1326 DetectImageType(imageType, pAttribute))) { 1326 DetectImageType(imageType, pAttribute)) {
1327 m_imagType = imageType; 1327 m_imagType = imageType;
1328 m_status = FXCODEC_STATUS_FRAME_READY; 1328 m_status = FXCODEC_STATUS_FRAME_READY;
1329 return m_status; 1329 return m_status;
1330 } 1330 }
1331 // If we got here then the image data does not match the requested decoder.
1332 // If we're skipping the type check then bail out at this point and return
1333 // the failed status.
1334 if (bSkipImageTypeCheck)
1335 return m_status;
1336
1331 for (int type = FXCODEC_IMAGE_BMP; type < FXCODEC_IMAGE_MAX; type++) { 1337 for (int type = FXCODEC_IMAGE_BMP; type < FXCODEC_IMAGE_MAX; type++) {
1332 if (DetectImageType((FXCODEC_IMAGE_TYPE)type, pAttribute)) { 1338 if (DetectImageType((FXCODEC_IMAGE_TYPE)type, pAttribute)) {
1333 m_imagType = (FXCODEC_IMAGE_TYPE)type; 1339 m_imagType = (FXCODEC_IMAGE_TYPE)type;
1334 m_status = FXCODEC_STATUS_FRAME_READY; 1340 m_status = FXCODEC_STATUS_FRAME_READY;
1335 return m_status; 1341 return m_status;
1336 } 1342 }
1337 } 1343 }
1338 m_status = FXCODEC_STATUS_ERR_FORMAT; 1344 m_status = FXCODEC_STATUS_ERR_FORMAT;
1339 m_pFile = nullptr; 1345 m_pFile = nullptr;
1340 return m_status; 1346 return m_status;
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 return m_status; 2369 return m_status;
2364 } 2370 }
2365 default: 2371 default:
2366 return FXCODEC_STATUS_ERROR; 2372 return FXCODEC_STATUS_ERROR;
2367 } 2373 }
2368 } 2374 }
2369 2375
2370 CCodec_ProgressiveDecoder* CCodec_ModuleMgr::CreateProgressiveDecoder() { 2376 CCodec_ProgressiveDecoder* CCodec_ModuleMgr::CreateProgressiveDecoder() {
2371 return new CCodec_ProgressiveDecoder(this); 2377 return new CCodec_ProgressiveDecoder(this);
2372 } 2378 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698