summaryrefslogtreecommitdiff
path: root/core/src/fpdftext/fpdf_text_int.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdftext/fpdf_text_int.cpp')
-rw-r--r--core/src/fpdftext/fpdf_text_int.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index e427a1d2a8..152bb4448f 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -1339,7 +1339,7 @@ int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) {
for (n = 0; n < nContentMark; n++) {
CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
- pDict = (CPDF_Dictionary*)item.GetParam();
+ pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
CPDF_String* temp =
(CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText"))
: NULL);
@@ -1410,8 +1410,12 @@ void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj) {
for (n = 0; n < nContentMark; n++) {
CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
- pDict = (CPDF_Dictionary*)item.GetParam();
- CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText"));
+
+ pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
+ CPDF_String* temp =
+ (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText"))
+ : NULL);
+
if (temp) {
actText = temp->GetUnicodeText();
}