Index: src/pdf/SkPDFTypes.cpp |
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp |
index 43cd68450fcd3895810806af1642ac6e5586c02d..8bb19360e121af8b34b075d65984ea7f251b5a48 100644 |
--- a/src/pdf/SkPDFTypes.cpp |
+++ b/src/pdf/SkPDFTypes.cpp |
@@ -26,7 +26,8 @@ SkPDFObjRef::SkPDFObjRef(SkPDFObject* obj) : fObj(obj) { |
SkPDFObjRef::~SkPDFObjRef() {} |
void SkPDFObjRef::emitObject(SkWStream* stream, SkPDFCatalog* catalog) { |
- stream->writeDecAsText(catalog->getObjectNumber(fObj.get())); |
+ SkPDFObject* obj = catalog->getSubstituteObject(fObj); |
+ stream->writeDecAsText(catalog->getObjectNumber(obj)); |
stream->writeText(" 0 R"); // Generation number is always 0. |
} |