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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 551503003: Check object type for objects used in the dictory of 'Index' (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 1b62b06749c5d92224e9d484b703b8d985c957eb..3a782625b6571a82dc3b0204d1fc333d3f0436ff 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -1034,9 +1034,12 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL
nSegs = 1;
} else {
for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- IndexArray.Add(pArray->GetInteger(i));
+ CPDF_Object* pObj = pArray->GetElement(i);
+ if (pObj && (pObj->GetType() == PDFOBJ_NUMBER)) {
Tom Sepez 2014/09/08 17:56:18 nit: no need for inner parenthesis here.
jun_fang 2014/09/09 18:51:25 For fuzz tests, elements in the index array can be
+ IndexArray.Add(pObj->GetInteger());
+ }
Tom Sepez 2014/09/08 17:56:18 This looks like one of those arrays which needs to
}
- nSegs = pArray->GetCount() / 2;
+ nSegs = IndexArray.GetSize() / 2;
}
Tom Sepez 2014/09/08 17:56:18 nit: I worry about a change down the road where In
pArray = pStream->GetDict()->GetArray(FX_BSTRC("W"));
if (pArray == NULL) {
« 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