forked from mirrors/gecko-dev
Bug 1945624. r=aosmond a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D236664
This commit is contained in:
parent
1594f8f8d0
commit
1efaf9ba41
1 changed files with 3 additions and 1 deletions
|
|
@ -61,7 +61,9 @@ public:
|
|||
void resizeToAtLeast(int count) {
|
||||
if (count > fCount) {
|
||||
// leave at least 50% extra space for future growth.
|
||||
count += count >> 1;
|
||||
SkSafeMath safe;
|
||||
int newCount = safe.addInt(count, count >> 1);
|
||||
count = safe ? newCount : SK_MaxS32;
|
||||
fMalloc.realloc(count);
|
||||
if (fPtr == fStack) {
|
||||
memcpy(fMalloc.get(), fStack, fCount * sizeof(SkRegionPriv::RunType));
|
||||
|
|
|
|||
Loading…
Reference in a new issue