[UBsan] Fixed int overflow