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

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

Issue 22269002: pdfviewer: debug code for crash (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/SkPdfRenderer.cpp ('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/SkPdfNativeTokenizer.cpp
===================================================================
--- experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp (revision 10543)
+++ experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp (working copy)
@@ -929,6 +929,11 @@
}
bool SkPdfNativeTokenizer::readTokenCore(PdfToken* token) {
+ SkPdfObject obj;
+#ifdef PDF_TRACE_READ_TOKEN
+ static int read_op = 0;
+ int last;
+#endif
token->fKeyword = NULL;
token->fObject = NULL;
@@ -937,8 +942,18 @@
return false;
}
- SkPdfObject obj;
+#ifdef PDF_TRACE_READ_TOKEN
+ printf("BEFORE the read: %i\n", read_op);
+ last = read_op;
+#endif
+
fUncompressedStream = nextObject(0, fUncompressedStream, fUncompressedStreamEnd, &obj, fAllocator, fDoc);
+#ifdef PDF_TRACE_READ_TOKEN
+ printf("BEFORE the read: %i\n", read_op);
+ if (last != read_op) {
+ printf("break; // memory override");
+ }
+#endif
// If it is a keyword, we will only get the pointer of the string
if (obj.type() == SkPdfObject::kKeyword_PdfObjectType) {
@@ -953,7 +968,6 @@
}
#ifdef PDF_TRACE_READ_TOKEN
- static int read_op = 0;
read_op++;
#if 0
if (548 == read_op) {
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698