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

Unified Diff: experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp

Issue 72053002: pdfviewer: readobject can return null, and catalog can be null (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: reupload Created 7 years, 1 month 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: experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp
diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp b/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp
index 19f15d1399f0fb6e551cb71667e4c66a942292ef..1d8f510f7f0a7f34d6521cdb48d1b0d875051f15 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 {
« 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