mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 23:11:04 +01:00
[sanitize] Simplify(?) check_range
This commit is contained in:
1 parent
fe94c760e1
commit
af0b1ef8a7
1 file changed
+3
-13
+3
-13
@@ -248,25 +248,15 @@ struct hb_sanitize_context_t :
|
||||
return likely (ok);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool check_range (const T *base,
|
||||
unsigned int a,
|
||||
unsigned int b) const
|
||||
{
|
||||
unsigned m;
|
||||
return !hb_unsigned_mul_overflows (a, b, &m) &&
|
||||
this->check_range (base, m);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <typename T, typename ...Ts>
|
||||
bool check_range (const T *base,
|
||||
unsigned int a,
|
||||
unsigned int b,
|
||||
unsigned int c) const
|
||||
Ts&... ds) const
|
||||
{
|
||||
unsigned m;
|
||||
return !hb_unsigned_mul_overflows (a, b, &m) &&
|
||||
this->check_range (base, m, c);
|
||||
this->check_range (base, m, ds...);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in new issue
Block a user