summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-08-31 15:04:12 -0700
committerTom Sepez <tsepez@chromium.org>2015-08-31 15:04:12 -0700
commitaecd9d0c5cfc569269bfe6cc228efaab76a7bb1b (patch)
tree900ce5de046b972e60440327249d7c71e9f8788f /fpdfsdk/src/javascript
parent7600f4b5054838abc9372f20ca950da6d3c57c7b (diff)
downloadpdfium-aecd9d0c5cfc569269bfe6cc228efaab76a7bb1b.tar.xz
Merge to XFA: Fix two issues shown by bug 489995
(cherry picked from commit 6e369c2ebb4769a42736b32154c0de12b73df45d) Original Review URL: https://codereview.chromium.org/1327473002 . BUG=489995 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1325743002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 7f078e5a5e..1e8d4fde8f 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1408,8 +1408,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();