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

Unified Diff: fpdfsdk/src/javascript/Document.cpp

Issue 1327473002: Fix two issues shown by bug 489995 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add test for addIcon() Created 5 years, 4 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
Index: fpdfsdk/src/javascript/Document.cpp
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index a8797095d81b10d4650cec165306371e54d107aa..91805b825e9e118de62e1e2551398c9d6c18bd19 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1367,8 +1367,12 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc,
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
return FALSE;
}
-
CFX_WideString swIconName = params[0].ToCFXWideString();
+
+ if (params[1].GetType() != VT_object) {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR);
+ return FALSE;
+ }
JSFXObject pJSIcon = params[1].ToV8Object();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp ('k') | testing/resources/javascript/document_methods.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698