[PDF] Handle failures of matrix inversion.

Review URL: https://codereview.appspot.com/6033047

git-svn-id: http://skia.googlecode.com/svn/trunk@3711 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 7e85afd..733a612 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -491,6 +491,8 @@
         drawingSize.set(SkIntToScalar(contentSize.fWidth),
                         SkIntToScalar(contentSize.fHeight));
         if (!initialTransform->invert(&inverse)) {
+            // This shouldn't happen, initial transform should be invertible.
+            SkASSERT(false);
             inverse.reset();
         }
         inverse.mapVectors(&drawingSize, 1);
@@ -603,7 +605,7 @@
     totalTransform.preConcat(contentEntry->fState.fMatrix);
     SkMatrix inverse;
     if (!totalTransform.invert(&inverse)) {
-        inverse.reset();
+        return;
     }
     inverse.mapRect(&bbox);