Index: gm/gmmain.cpp |
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp |
index ece8ff32d4888f0d26cb2768df7c4ed5d7b118e6..1652e61f7c0d092378ae2ccce06177bb50861c77 100644 |
--- a/gm/gmmain.cpp |
+++ b/gm/gmmain.cpp |
@@ -704,8 +704,10 @@ public: |
SkRect content = SkRect::MakeWH(SkIntToScalar(pageSize.width()), |
SkIntToScalar(pageSize.height())); |
initialTransform.mapRect(&content); |
- content.intersect(0, 0, SkIntToScalar(pageSize.width()), |
- SkIntToScalar(pageSize.height())); |
+ if (!content.intersect(0, 0, SkIntToScalar(pageSize.width()), |
+ SkIntToScalar(pageSize.height()))) { |
+ content.setEmpty(); |
+ } |
SkISize contentSize = |
SkISize::Make(SkScalarRoundToInt(content.width()), |
SkScalarRoundToInt(content.height())); |