Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

VRFrameData::from_bytes is unsound #19

Open
nox opened this issue Mar 16, 2018 · 1 comment
Open

VRFrameData::from_bytes is unsound #19

nox opened this issue Mar 16, 2018 · 1 comment

Comments

@nox
Copy link
Contributor

nox commented Mar 16, 2018

This method builds a VRPose (for the pose field) out of a slice of bytes, but the VRPose struct contains Option<f64> types which don't have a specified layout and most importantly for which not all [u8] slices represent a valid value. VRPose::from_bytes should be unsafe.

https://github.com/MortimerGoro/rust-webvr/blob/cab969ee734908ebaac7667bbd4cd903e2135dd5/rust-webvr-api/src/vr_frame_data.rs#L54

@MortimerGoro
Copy link
Contributor

Using the slice of bytes was a design decision to decouple Webrender and the WebVR implementation. This allowed for a quicker pull request cycle and avoided dependency version conflicts.

Now that WebGL/WebVR are not included in Webrender we can remove the byte slice conversions and use standard serde serialization.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants