Index: src/pdf/SkPDFFormXObject.cpp |
diff --git a/src/pdf/SkPDFFormXObject.cpp b/src/pdf/SkPDFFormXObject.cpp |
index fb8a9159cf650f8149fb571a383135732bcff645..f368834938766f427ec569bc449e5612c9c26013 100644 |
--- a/src/pdf/SkPDFFormXObject.cpp |
+++ b/src/pdf/SkPDFFormXObject.cpp |
@@ -36,8 +36,9 @@ SkPDFFormXObject::SkPDFFormXObject(SkPDFDevice* device) { |
// embedded in things like shaders and images. |
if (!device->initialTransform().isIdentity()) { |
SkMatrix inverse; |
- inverse.reset(); |
- device->initialTransform().invert(&inverse); |
+ if (!device->initialTransform().invert(&inverse)) { |
+ inverse.reset(); |
+ } |
insert("Matrix", SkPDFUtils::MatrixToArray(inverse))->unref(); |
} |