From d9c0f0b57affec7a472879c5919acac6637d926a Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Fri, 6 Feb 2009 22:39:37 +0000 Subject: [PATCH] check for non-invertible matrices in getClipBounds() git-svn-id: http://skia.googlecode.com/svn/trunk@89 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkCanvas.cpp | 10 ++++++---- 1 file 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 -- 2.34.1