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

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

Issue 23033022: pdfviewer: when q start, and an operator is called, it should not be able to see operands before q.… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | « experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.h ('k') | 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
===================================================================
--- experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp (revision 10854)
+++ experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp (working copy)
@@ -358,6 +358,7 @@
fObjects[id].fOffset = offset;
fObjects[id].fObj = NULL;
fObjects[id].fResolvedReference = NULL;
+ fObjects[id].fIsReferenceResolved = false;
}
SkPdfNativeObject* SkPdfNativeDoc::readObject(int id/*, int expectedGeneration*/) {
@@ -546,15 +547,22 @@
return NULL;
}
- if (fObjects[id].fResolvedReference != NULL) {
+ if (fObjects[id].fIsReferenceResolved) {
#ifdef PDF_TRACE
printf("\nresolve(%s) = %s\n", ref->toString(0).c_str(), fObjects[id].fResolvedReference->toString(0, ref->toString().size() + 13).c_str());
#endif
+ // TODO(edisonn): for known good documents, assert here THAT THE REFERENCE IS NOT null
return fObjects[id].fResolvedReference;
}
+ // TODO(edisonn): there are pdfs in the crashing suite that cause a stack overflow here unless we check for resolved reference on next line
+ // determine if the pdf is corrupted, or we have a bug here
+
+ // avoids recursive calls
+ fObjects[id].fIsReferenceResolved = true;
+
if (fObjects[id].fObj == NULL) {
fObjects[id].fObj = readObject(id);
}
« no previous file with comments | « experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698