Check for (impossible) overflow
This commit is contained in:
parent
9fc8684fd8
commit
9ac7dc73bc
|
@ -322,6 +322,7 @@ struct AnchorMatrix
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF, unsigned int cols) {
|
inline bool sanitize (SANITIZE_ARG_DEF, unsigned int cols) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (!SANITIZE_SELF ()) return false;
|
if (!SANITIZE_SELF ()) return false;
|
||||||
|
if (HB_UNLIKELY (cols >= ((unsigned int) -1) / rows)) return false;
|
||||||
unsigned int count = rows * cols;
|
unsigned int count = rows * cols;
|
||||||
if (!SANITIZE_ARRAY (matrix, matrix[0].get_size (), count)) return false;
|
if (!SANITIZE_ARRAY (matrix, matrix[0].get_size (), count)) return false;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
|
|
Loading…
Reference in New Issue