aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/PdfViewer/pdfparser/native
diff options
context:
space:
mode:
authorGravatar edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-06 21:48:44 +0000
committerGravatar edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-06 21:48:44 +0000
commit2273f9b45fb78b0cc7df81f96f74b0c3c0e6cc37 (patch)
tree272ed793ffbbb0294d80da2bc361ba3a3eb25935 /experimental/PdfViewer/pdfparser/native
parent9c8b4eaf280630438d32fee8acd04edad2414d54 (diff)
pdfviewer: load image pain settings (like transparency), pass the page number, report failure if at least one render fails, and check that xref section starts with xref keyword.
Review URL: https://codereview.chromium.org/22465006 git-svn-id: http://skia.googlecode.com/svn/trunk@10588 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/PdfViewer/pdfparser/native')
-rw-r--r--experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp b/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp
index 6386f988e3..333b0a25db 100644
--- a/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp
+++ b/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp
@@ -225,7 +225,12 @@ SkNativeParsedPDF::~SkNativeParsedPDF() {
}
const unsigned char* SkNativeParsedPDF::readCrossReferenceSection(const unsigned char* xrefStart, const unsigned char* trailerEnd) {
- const unsigned char* current = ignoreLine(xrefStart, trailerEnd); // TODO(edisonn): verify next keyord is "xref", use nextObject here
+ SkPdfObject xref;
+ const unsigned char* current = nextObject(0, xrefStart, trailerEnd, &xref, NULL, NULL);
+
+ if (!xref.isKeyword("xref")) {
+ return trailerEnd;
+ }
SkPdfObject token;
while (current < trailerEnd) {