Index: include/core/SkImageInfo.h |
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h |
index daa50dcdb22a28fae6d4182dbe595471a0786e44..9a1ea5f5ee90d2e107a5e60b335df8dfb1be60c7 100644 |
--- a/include/core/SkImageInfo.h |
+++ b/include/core/SkImageInfo.h |
@@ -282,7 +282,11 @@ public: |
} |
size_t getSafeSize(size_t rowBytes) const { |
- return (size_t)this->getSafeSize64(rowBytes); |
+ int64_t size = this->getSafeSize64(rowBytes); |
+ if (!sk_64_isS32(size)) { |
+ return 0; |
+ } |
+ return sk_64_asS32(size); |
} |
bool validRowBytes(size_t rowBytes) const { |