diff options
author | halcanary <halcanary@google.com> | 2015-03-26 15:35:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-26 15:35:18 -0700 |
commit | 41f88f0251cf48eb06f3f8d143aac8562a230889 (patch) | |
tree | 3ef320a471b63f2fdb5dbc5693a85932efbf260a /src/doc | |
parent | e833107a30b240e0685b354838bf6098066da6f8 (diff) |
SkPDF fix object counting error
Review URL: https://codereview.chromium.org/1012483003
Diffstat (limited to 'src/doc')
-rw-r--r-- | src/doc/SkDocument_PDF.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/doc/SkDocument_PDF.cpp b/src/doc/SkDocument_PDF.cpp index ae01c82141..3b46fb646e 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); |