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

Unified Diff: core/src/fpdfdoc/doc_basic.cpp

Issue 378293005: Fix a null object check (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_basic.cpp
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index 25f641c52e8d1111fbd1de8a2aceb8b61953f94d..5ccf4ceee9a32448d0fff99c6ad1a2dc7a6aa98c 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -46,7 +46,9 @@ int CPDF_Dest::GetZoomMode()
if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
return 0;
}
- CFX_ByteString mode = ((CPDF_Array*)m_pObj)->GetElementValue(1)->GetString();
+ CFX_ByteString mode;
+ CPDF_Object* pObj = ((CPDF_Array*)m_pObj)->GetElementValue(1);
+ mode = pObj ? pObj->GetString() : CFX_ByteString();
int i = 0;
while (g_sZoomModes[i][0] != '\0') {
if (mode == g_sZoomModes[i]) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698