Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: src/core/SkMallocPixelRef.cpp

Issue 122293002: Revert "Revert of https://codereview.chromium.org/113823003/" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkMipMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMallocPixelRef.cpp
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index b65197fac852ae7e5dceb3bf4ed4764dc92cd087..9e2ea9c9803c6475b02263325a9bc2fbbc958726 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -64,13 +64,12 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info,
rowBytes = minRB;
}
- Sk64 bigSize;
- bigSize.setMul(info.fHeight, rowBytes);
- if (!bigSize.is32()) {
+ int64_t bigSize = (int64_t)info.fHeight * rowBytes;
+ if (!sk_64_isS32(bigSize)) {
return NULL;
}
- size_t size = bigSize.get32();
+ size_t size = sk_64_asS32(bigSize);
void* addr = sk_malloc_flags(size, 0);
if (NULL == addr) {
return NULL;
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkMipMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698