Open mooman219 opened 4 years ago
https://github.com/raphlinus/font-rs/blob/ad0b79ea9b76cc80687ad4363d4fa692fbd0ddf8/src/raster.rs#L82
x0i can be -1 in this case, and casting it to usize will give usize max. The addition with linestart will cause an arithmetic overflow. Wrapping add should be used.
x0i
-1
usize
linestart
https://github.com/raphlinus/font-rs/blob/ad0b79ea9b76cc80687ad4363d4fa692fbd0ddf8/src/raster.rs#L82
x0i
can be-1
in this case, and casting it tousize
will giveusize
max. The addition withlinestart
will cause an arithmetic overflow. Wrapping add should be used.