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

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

Issue 1521543002: Fix a regression for parsing '/' - commit a568ff2d was too strict. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years 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 "parser_int.h" 7 #include "parser_int.h"
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2118 break; 2118 break;
2119 } 2119 }
2120 if (key[0] != '/') 2120 if (key[0] != '/')
2121 continue; 2121 continue;
2122 2122
2123 ++nKeys; 2123 ++nKeys;
2124 key = PDF_NameDecode(key); 2124 key = PDF_NameDecode(key);
2125 if (key.IsEmpty()) 2125 if (key.IsEmpty())
2126 continue; 2126 continue;
2127 2127
2128 CFX_ByteStringC keyNoSlash(key.c_str() + 1, key.GetLength() - 1);
2129 if (keyNoSlash.IsEmpty())
2130 continue;
2131
2132 if (key == FX_BSTRC("/Contents")) 2128 if (key == FX_BSTRC("/Contents"))
2133 dwSignValuePos = m_Pos; 2129 dwSignValuePos = m_Pos;
2134 2130
2135 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum); 2131 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum);
2136 if (!pObj) 2132 if (!pObj)
2137 continue; 2133 continue;
2138 2134
2135 CFX_ByteStringC keyNoSlash(key.c_str() + 1, key.GetLength() - 1);
2139 // TODO(thestig): Remove this conditional once CPDF_Dictionary has a 2136 // TODO(thestig): Remove this conditional once CPDF_Dictionary has a
2140 // better underlying map implementation. 2137 // better underlying map implementation.
2141 if (nKeys < 32) { 2138 if (nKeys < 32) {
2142 pDict->SetAt(keyNoSlash, pObj); 2139 pDict->SetAt(keyNoSlash, pObj);
2143 } else { 2140 } else {
2144 pDict->AddValue(keyNoSlash, pObj); 2141 pDict->AddValue(keyNoSlash, pObj);
2145 } 2142 }
2146 } 2143 }
2147 2144
2148 if (IsSignatureDict(pDict.get())) { 2145 if (IsSignatureDict(pDict.get())) {
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after
4950 if (!m_pLinearizedDict) 4947 if (!m_pLinearizedDict)
4951 return -1; 4948 return -1;
4952 CPDF_Array* pRange = m_pLinearizedDict->GetArray(FX_BSTRC("H")); 4949 CPDF_Array* pRange = m_pLinearizedDict->GetArray(FX_BSTRC("H"));
4953 if (!pRange) 4950 if (!pRange)
4954 return -1; 4951 return -1;
4955 CPDF_Object* pStreamLen = pRange->GetElementValue(1); 4952 CPDF_Object* pStreamLen = pRange->GetElementValue(1);
4956 if (!pStreamLen) 4953 if (!pStreamLen)
4957 return -1; 4954 return -1;
4958 return pStreamLen->GetInteger(); 4955 return pStreamLen->GetInteger();
4959 } 4956 }
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