Be a little more paranoid about some maths?
I was looking at a thing, saw a thing, here we are
It would appear that rather than preventing an overflow, we were hoping to detect it happened after doing the UB, which …is UB?
Might be worth checking other bits of code as well, this is just what I so happened to spot.