blob: cb69125edb2b8272da1764c0472922937c99c4e4 [file] [log] [blame]
/*
* Copyright 2023 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/base/SkSafeMath.h"
size_t SkSafeMath::Add(size_t x, size_t y) {
SkSafeMath tmp;
size_t sum = tmp.add(x, y);
return tmp.ok() ? sum : SIZE_MAX;
}
size_t SkSafeMath::Mul(size_t x, size_t y) {
SkSafeMath tmp;
size_t prod = tmp.mul(x, y);
return tmp.ok() ? prod : SIZE_MAX;
}