summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_doc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_doc.cpp')
-rw-r--r--fpdfsdk/fpdf_doc.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp
index 614462fa47..28c670c5dd 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -164,11 +164,14 @@ FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAction_GetType(FPDF_ACTION pDict) {
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFAction_GetDest(FPDF_DOCUMENT document,
FPDF_ACTION pDict) {
- if (!pDict)
- return nullptr;
CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
if (!pDoc)
return nullptr;
+
+ unsigned long type = FPDFAction_GetType(pDict);
+ if (type != PDFACTION_GOTO && type != PDFACTION_REMOTEGOTO)
+ return nullptr;
+
CPDF_Action action(CPDFDictionaryFromFPDFAction(pDict));
return FPDFDestFromCPDFArray(action.GetDest(pDoc).GetArray());
}
@@ -192,11 +195,14 @@ FPDFAction_GetURIPath(FPDF_DOCUMENT document,
FPDF_ACTION pDict,
void* buffer,
unsigned long buflen) {
- if (!pDict)
- return 0;
CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
if (!pDoc)
return 0;
+
+ unsigned long type = FPDFAction_GetType(pDict);
+ if (type != PDFACTION_URI)
+ return 0;
+
CPDF_Action action(CPDFDictionaryFromFPDFAction(pDict));
ByteString path = action.GetURI(pDoc);
unsigned long len = path.GetLength() + 1;