aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-02-06 22:39:37 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-02-06 22:39:37 +0000
commitd9c0f0b57affec7a472879c5919acac6637d926a (patch)
tree93878f9d80b2ddbcd8b66c767410495578db9b72
parentc07d23a6e220c0aff36e3e4e06c1b685a440108e (diff)
check for non-invertible matrices in getClipBounds()
git-svn-id: http://skia.googlecode.com/svn/trunk@89 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/core/SkCanvas.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 40884164d3..72988643c8 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -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