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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_document.cpp

Issue 2003873002: Fix infinite recursion in CPDF_DocPageData::GetColorSpace(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 7 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 | « core/fpdfapi/fpdf_page/pageint.h ('k') | 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/fpdfapi/fpdf_parser/include/cpdf_document.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 pKidList->RemoveAt(i); 387 pKidList->RemoveAt(i);
388 } 388 }
389 pPages->SetAtInteger( 389 pPages->SetAtInteger(
390 "Count", pPages->GetIntegerBy("Count") + (bInsert ? 1 : -1)); 390 "Count", pPages->GetIntegerBy("Count") + (bInsert ? 1 : -1));
391 return 1; 391 return 1;
392 } 392 }
393 nPagesToGo--; 393 nPagesToGo--;
394 } else { 394 } else {
395 int nPages = pKid->GetIntegerBy("Count"); 395 int nPages = pKid->GetIntegerBy("Count");
396 if (nPagesToGo < nPages) { 396 if (nPagesToGo < nPages) {
397 if (pdfium::ContainsValue(*pVisited, pKid)) 397 if (pdfium::ContainsKey(*pVisited, pKid))
398 return -1; 398 return -1;
399 pdfium::ScopedSetInsertion<CPDF_Dictionary*>(pVisited, pKid); 399
400 pdfium::ScopedSetInsertion<CPDF_Dictionary*> insertion(pVisited, pKid);
Lei Zhang 2016/05/23 16:23:20 Umm, not sure what happened here.
Tom Sepez 2016/05/23 16:33:04 Argh. Well, at least it existed until the ; at eo
400 if (InsertDeletePDFPage(pDoc, pKid, nPagesToGo, pPage, bInsert, 401 if (InsertDeletePDFPage(pDoc, pKid, nPagesToGo, pPage, bInsert,
401 pVisited) < 0) { 402 pVisited) < 0) {
402 return -1; 403 return -1;
403 } 404 }
404 pPages->SetAtInteger( 405 pPages->SetAtInteger(
405 "Count", pPages->GetIntegerBy("Count") + (bInsert ? 1 : -1)); 406 "Count", pPages->GetIntegerBy("Count") + (bInsert ? 1 : -1));
406 return 1; 407 return 1;
407 } 408 }
408 nPagesToGo -= nPages; 409 nPagesToGo -= nPages;
409 } 410 }
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 } 1440 }
1440 } 1441 }
1441 pFontDesc->SetAtInteger("StemV", fStemV); 1442 pFontDesc->SetAtInteger("StemV", fStemV);
1442 AddIndirectObject(pFontDesc); 1443 AddIndirectObject(pFontDesc);
1443 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc); 1444 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
1444 CFRelease(traits); 1445 CFRelease(traits);
1445 CFRelease(languages); 1446 CFRelease(languages);
1446 return LoadFont(pBaseDict); 1447 return LoadFont(pBaseDict);
1447 } 1448 }
1448 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 1449 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/pageint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698