aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2015-05-27 20:42:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-27 20:42:51 +0000
commitf7d70b78303f4d930a222bbab4b2eaa6c966d3e5 (patch)
treea943c17dedd49a82cf60a4610fb0ebbec84ee52b
parent7b6865e9b5bcccd2e046f64d8b8fba8c9c045a23 (diff)
parent60ed36dfef57fc77159096db59a2bc9b233d23f0 (diff)
downloadskia-f7d70b78303f4d930a222bbab4b2eaa6c966d3e5.tar.gz
am 60ed36df: Revert "DO NOT MERGE: Prevent integer wrap around for malloc size when creating a SkRegion"
* commit '60ed36dfef57fc77159096db59a2bc9b233d23f0': Revert "DO NOT MERGE: Prevent integer wrap around for malloc size when creating a SkRegion"
-rw-r--r--src/core/SkRegionPriv.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/core/SkRegionPriv.h b/src/core/SkRegionPriv.h
index 2576840172..c8f000df35 100644
--- a/src/core/SkRegionPriv.h
+++ b/src/core/SkRegionPriv.h
@@ -12,7 +12,6 @@
#include "SkRegion.h"
#include "SkThread.h"
-#include "Sk64.h"
#define assert_sentinel(value, isSentinel) \
SkASSERT(((value) == SkRegion::kRunTypeSentinel) == isSentinel)
@@ -66,12 +65,7 @@ public:
SkASSERT(count >= SkRegion::kRectRegionRuns);
- Sk64 size64;
- size64.setMul(count, sizeof(RunType));
- size64.add(sizeof(RunHead));
- if (count < 0 || !size64.is32()) { SK_CRASH(); }
-
- RunHead* head = (RunHead*)sk_malloc_throw(size64.get32());
+ RunHead* head = (RunHead*)sk_malloc_throw(sizeof(RunHead) + count * sizeof(RunType));
head->fRefCnt = 1;
head->fRunCount = count;
// these must be filled in later, otherwise we will be invalid