check for non-invertible matrices in getClipBounds()
authorreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 6 Feb 2009 22:39:37 +0000 (22:39 +0000)
committerreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 6 Feb 2009 22:39:37 +0000 (22:39 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@89 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkCanvas.cpp

index 40884164d3bc2e3d7e051d5a25ad1f59d7d6bd64..72988643c8abaa5085f2beae8c19cacbe36d1102 100644 (file)
@@ -957,12 +957,14 @@ bool SkCanvas::getClipBounds(SkRect* bounds, EdgeType et) const {
         return false;
     }
 
+    SkMatrix inverse;
+    // if we can't invert the CTM, we can't return local clip bounds
+    if (!fMCRec->fMatrix->invert(&inverse)) {
+        return false;
+    }
+
     if (NULL != bounds) {
-        SkMatrix inverse;
         SkRect   r;
-
-        fMCRec->fMatrix->invert(&inverse);
-        
         // get the clip's bounds
         const SkIRect& ibounds = clip.getBounds();
         // adjust it outwards if we are antialiasing