Bug 1945624. r=aosmond a=dmeehan

Differential Revision: https://phabricator.services.mozilla.com/D236664
This commit is contained in:
Lee Salzman 2025-02-10 14:49:37 +00:00
parent 1594f8f8d0
commit 1efaf9ba41

View file

@ -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));