Check Null pointer in CPDF_Dictionary::GetUnicodeText
authorBo Xu <bo_xu@foxitsoftware.com>
Mon, 15 Sep 2014 18:28:25 +0000 (11:28 -0700)
committerBo Xu <bo_xu@foxitsoftware.com>
Mon, 15 Sep 2014 18:28:25 +0000 (11:28 -0700)
BUG=414155
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/574463002

core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp

index e945ab5..07b447b 100644 (file)
@@ -626,7 +626,9 @@ CFX_WideString CPDF_Dictionary::GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMa
     if (p) {
         if(p->GetType() == PDFOBJ_REFERENCE) {
             p = ((CPDF_Reference*)p)->GetDirect();
-            return p->GetUnicodeText(pCharMap);
+            if (p) {
+                return p->GetUnicodeText(pCharMap);
+            }
         } else {
             return p->GetUnicodeText(pCharMap);
         }