diff options
author | edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-13 20:23:40 +0000 |
---|---|---|
committer | edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-13 20:23:40 +0000 |
commit | 608c35e5c4ce61a79b7a0567c8eca569332c2dde (patch) | |
tree | 8dd4af25ba21266b701bb440123e3153945f6e7a /experimental/PdfViewer/pdfparser | |
parent | 04306921f45c91ceec73bb96a427e4c69cf9782c (diff) |
pdfviewer: readobject can return null, and catalog can be null
Review URL: https://codereview.chromium.org/72053002
git-svn-id: http://skia.googlecode.com/svn/trunk@12276 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/PdfViewer/pdfparser')
-rw-r--r-- | experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp b/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp index 19f15d1399..1d8f510f7f 100644 --- a/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp +++ b/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp @@ -140,7 +140,7 @@ void SkPdfNativeDoc::init(const void* bytes, size_t length) { if (fRootCatalogRef) { fRootCatalog = (SkPdfCatalogDictionary*)resolveReference(fRootCatalogRef); - if (fRootCatalog->isDictionary() && fRootCatalog->valid()) { + if (fRootCatalog != NULL && fRootCatalog->isDictionary() && fRootCatalog->valid()) { SkPdfPageTreeNodeDictionary* tree = fRootCatalog->Pages(this); if (tree && tree->isDictionary() && tree->valid()) { fillPages(tree); @@ -222,7 +222,7 @@ void SkPdfNativeDoc::loadWithoutXRef() { if (fRootCatalogRef) { fRootCatalog = (SkPdfCatalogDictionary*)resolveReference(fRootCatalogRef); - if (fRootCatalog->isDictionary() && fRootCatalog->valid()) { + if (fRootCatalog != NULL && fRootCatalog->isDictionary() && fRootCatalog->valid()) { SkPdfPageTreeNodeDictionary* tree = fRootCatalog->Pages(this); if (tree && tree->isDictionary() && tree->valid()) { fillPages(tree); @@ -583,7 +583,7 @@ SkPdfNativeObject* SkPdfNativeDoc::resolveReference(SkPdfNativeObject* ref) { fObjects[id].fObj = readObject(id); } - if (fObjects[id].fResolvedReference == NULL) { + if (fObjects[id].fObj != NULL && fObjects[id].fResolvedReference == NULL) { if (!fObjects[id].fObj->isReference()) { fObjects[id].fResolvedReference = fObjects[id].fObj; } else { |