mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
webxr: Add some missing internal checks/validation (#33318)
* Ensure depthFar is non-negative Signed-off-by: Daniel Adams <msub2official@gmail.com> * Properly append default features in requestSession Signed-off-by: Daniel Adams <msub2official@gmail.com> * Ensure XRRigidTransform init members have finite values Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
aadc212b95
commit
75c7712905
9 changed files with 35 additions and 40 deletions
|
@ -83,6 +83,26 @@ impl XRRigidTransform {
|
|||
)));
|
||||
}
|
||||
|
||||
if !position.x.is_finite() ||
|
||||
!position.y.is_finite() ||
|
||||
!position.z.is_finite() ||
|
||||
!position.w.is_finite()
|
||||
{
|
||||
return Err(Error::Type(
|
||||
"Position must not contain non-finite values".into(),
|
||||
));
|
||||
}
|
||||
|
||||
if !orientation.x.is_finite() ||
|
||||
!orientation.y.is_finite() ||
|
||||
!orientation.z.is_finite() ||
|
||||
!orientation.w.is_finite()
|
||||
{
|
||||
return Err(Error::Type(
|
||||
"Orientation must not contain non-finite values".into(),
|
||||
));
|
||||
}
|
||||
|
||||
let translate = Vector3D::new(position.x as f32, position.y as f32, position.z as f32);
|
||||
let rotate = Rotation3D::unit_quaternion(
|
||||
orientation.x as f32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue