Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong end in get_plane_mapping() of DqBuffer #44

Closed
rosetta-jpn opened this issue Jan 17, 2025 · 2 comments
Closed

wrong end in get_plane_mapping() of DqBuffer #44

rosetta-jpn opened this issue Jan 17, 2025 · 2 comments

Comments

@rosetta-jpn
Copy link
Contributor

rosetta-jpn commented Jan 17, 2025

V4L2 specification states

Note
That data_offset is included in bytesused. So the size of the image in the plane is bytesused-data_offset at offset data_offset from the start of the plane.

So the plane data is from data_offset to bytesused.

But the current DqBuffer's get_plane_mapping() implementation is

let start = *plane_data.data_offset.unwrap_or(&0) as usize;  
let end = start + *plane_data.bytesused as usize;

This may casues the out-of-bound buffer in mmaping and accessing.

@rosetta-jpn
Copy link
Contributor Author

Upload the fix => #44

@Gnurou
Copy link
Owner

Gnurou commented Jan 17, 2025

Fixed by #45.

@Gnurou Gnurou closed this as completed Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants