aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMallocPixelRef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkMallocPixelRef.cpp')
-rw-r--r--src/core/SkMallocPixelRef.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index 6928f38ee2..50ee91c676 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -35,9 +35,9 @@ sk_sp<SkPixelRef> SkMallocPixelRef::MakeDirect(const SkImageInfo& info,
}
- sk_sp<SkPixelRef> SkMallocPixelRef::MakeUsing(void*(*alloc)(size_t),
- const SkImageInfo& info,
- size_t requestedRowBytes) {
+sk_sp<SkPixelRef> SkMallocPixelRef::MakeUsing(void*(*alloc)(size_t),
+ const SkImageInfo& info,
+ size_t requestedRowBytes) {
if (!is_valid(info)) {
return nullptr;
}
@@ -65,13 +65,14 @@ sk_sp<SkPixelRef> SkMallocPixelRef::MakeDirect(const SkImageInfo& info,
size_t size = sk_64_asS32(bigSize);
SkASSERT(size >= info.getSafeSize(rowBytes));
+ SkASSERT(info.getSafeSize(rowBytes) == info.computeByteSize(rowBytes));
void* addr = alloc(size);
if (nullptr == addr) {
return nullptr;
}
- return sk_sp<SkPixelRef>(new SkMallocPixelRef(info, addr, rowBytes,
- sk_free_releaseproc, nullptr));
+ return sk_sp<SkPixelRef>(new SkMallocPixelRef(info, addr, rowBytes,
+ sk_free_releaseproc, nullptr));
}
sk_sp<SkPixelRef> SkMallocPixelRef::MakeAllocate(const SkImageInfo& info,