summaryrefslogtreecommitdiff
path: root/gfx/skia/trunk/src/core/SkMallocPixelRef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/skia/trunk/src/core/SkMallocPixelRef.cpp')
-rw-r--r--gfx/skia/trunk/src/core/SkMallocPixelRef.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/gfx/skia/trunk/src/core/SkMallocPixelRef.cpp b/gfx/skia/trunk/src/core/SkMallocPixelRef.cpp
index 0d5016483..10d8bc5f2 100644
--- a/gfx/skia/trunk/src/core/SkMallocPixelRef.cpp
+++ b/gfx/skia/trunk/src/core/SkMallocPixelRef.cpp
@@ -8,8 +8,21 @@
#include "SkMallocPixelRef.h"
#include "SkBitmap.h"
#include "SkReadBuffer.h"
+#include "SkSafeMath.h"
#include "SkWriteBuffer.h"
+void* sk_calloc_throw(size_t count, size_t elemSize) {
+ return sk_calloc_throw(SkSafeMath::Mul(count, elemSize));
+}
+
+void* sk_malloc_throw(size_t count, size_t elemSize) {
+ return sk_malloc_throw(SkSafeMath::Mul(count, elemSize));
+}
+
+void* sk_realloc_throw(void* buffer, size_t count, size_t elemSize) {
+ return sk_realloc_throw(buffer, SkSafeMath::Mul(count, elemSize));
+}
+
// assumes ptr was allocated via sk_malloc
static void sk_free_releaseproc(void* ptr, void*) {
sk_free(ptr);