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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 534763002: Check m_nComponents when using JBIG2Decode (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 3 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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxcodec/fx_codec.h" 8 #include "../../../include/fxcodec/fx_codec.h"
9 #include "../../../include/fpdfapi/fpdf_module.h" 9 #include "../../../include/fpdfapi/fpdf_module.h"
10 #include "../../../include/fpdfapi/fpdf_render.h" 10 #include "../../../include/fpdfapi/fpdf_render.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 if (!src_pitch.IsValid()) { 331 if (!src_pitch.IsValid()) {
332 return 0; 332 return 0;
333 } 333 }
334 334
335 m_pStreamAcc = FX_NEW CPDF_StreamAcc; 335 m_pStreamAcc = FX_NEW CPDF_StreamAcc;
336 m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE); 336 m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE);
337 if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) { 337 if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
338 return 0; 338 return 0;
339 } 339 }
340 const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder(); 340 const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
341 if (!decoder.IsEmpty() && decoder == FX_BSTRC("CCITTFaxDecode")) { 341 if (!decoder.IsEmpty()) {
342 m_bpc = 1; 342 if (decoder == FX_BSTRC("CCITTFaxDecode")) {
343 m_bpc = 1;
344 }
345 if (decoder == FX_BSTRC("JBIG2Decode")) {
346 m_nComponents = 1;
347 }
348
Tom Sepez 2014/09/02 21:32:31 nit: no blank line here.
343 } 349 }
344 int ret = CreateDecoder(); 350 int ret = CreateDecoder();
345 if (ret != 1) { 351 if (ret != 1) {
346 if (!ret) { 352 if (!ret) {
347 return ret; 353 return ret;
348 } 354 }
349 if (!ContinueToLoadMask()) { 355 if (!ContinueToLoadMask()) {
350 return 0; 356 return 0;
351 } 357 }
352 if (m_bHasMask) { 358 if (m_bHasMask) {
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 if (!m_bCached) { 1558 if (!m_bCached) {
1553 if (m_pBitmap) { 1559 if (m_pBitmap) {
1554 delete m_pBitmap; 1560 delete m_pBitmap;
1555 m_pBitmap = NULL; 1561 m_pBitmap = NULL;
1556 } 1562 }
1557 if (m_pMask) { 1563 if (m_pMask) {
1558 delete m_pMask; 1564 delete m_pMask;
1559 } 1565 }
1560 } 1566 }
1561 } 1567 }
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