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

Unified Diff: src/doc/SkDocument_PDF.cpp

Issue 1012483003: SkPDF fix object counting error (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/doc/SkDocument_PDF.cpp
diff --git a/src/doc/SkDocument_PDF.cpp b/src/doc/SkDocument_PDF.cpp
index ae01c82141d74972c97eb762c05b270acc601d0d..3b46fb646e367deefc9c2641fd23d795046ec1a9 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -229,10 +229,11 @@ static bool emit_pdf_document(const SkTDArray<const SkPDFDevice*>& pageDevices,
}
int32_t xRefFileOffset = SkToS32(stream->bytesWritten() - baseOffset);
+ // Include the zeroth object in the count.
int32_t objCount = SkToS32(offsets.count() + 1);
stream->writeText("xref\n0 ");
- stream->writeDecAsText(objCount + 1);
+ stream->writeDecAsText(objCount);
stream->writeText("\n0000000000 65535 f \n");
for (int i = 0; i < offsets.count(); i++) {
SkASSERT(offsets[i] > 0);
« 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