Index: src/core/SkMallocPixelRef.cpp |
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp |
index f4ba969662589131351aa7efa6141a1f9b53267b..12aa1f63d6197c1e189e6ca877df4b3d7694d923 100644 |
--- a/src/core/SkMallocPixelRef.cpp |
+++ b/src/core/SkMallocPixelRef.cpp |
@@ -56,8 +56,9 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info, |
return NULL; |
} |
- int32_t minRB = SkToS32(info.minRowBytes()); |
- if (minRB < 0) { |
+ // only want to permit 31bits of rowBytes |
+ int64_t minRB = (int64_t)info.minRowBytes64(); |
+ if (minRB < 0 || !sk_64_isS32(minRB)) { |
return NULL; // allocation will be too large |
} |
if (requestedRowBytes > 0 && (int32_t)requestedRowBytes < minRB) { |