Skip to content

wa added in frame size assertion, and processing block for mipi added #10794

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

Merged
merged 1 commit into from
Aug 21, 2022

Conversation

remibettan
Copy link
Contributor

Tracked by: DSO-18458

src/sensor.cpp Outdated
Comment on lines 479 to 486
if (req_profile_base->get_format() == RS2_FORMAT_Y12I)
{
assert(expected_size == sizeof(byte) * f.frame_size ||
expected_size * 3 / 4 == sizeof(byte) * f.frame_size);
if (expected_size == sizeof(byte) * f.frame_size)
memcpy((void*)fh->get_frame_data(), f.pixels, expected_size);
if (expected_size * 3 / 4 == sizeof(byte) * f.frame_size)
memcpy((void*)fh->get_frame_data(), f.pixels, expected_size * 3 / 4);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use a short-handed style:
expected_size *= (expected_size * 3 / 4 == sizeof(byte) * f.frame_size)) ? 3/4 : 1;
and then you can leave the original assert and memcpy in place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea - thanks

@remibettan remibettan changed the title wa added in frame size assertion, and define changed in processing block wa added in frame size assertion, and processing block for mipi added Aug 18, 2022
@remibettan remibettan force-pushed the D4XX_y16_crash_temp_fix branch from 21230f0 to f94c2c9 Compare August 18, 2022 18:35
@remibettan remibettan force-pushed the D4XX_y16_crash_temp_fix branch from f94c2c9 to 8366f5f Compare August 18, 2022 18:42
@remibettan remibettan marked this pull request as ready for review August 21, 2022 06:47
@remibettan remibettan requested a review from ev-mp August 21, 2022 07:09
Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@ev-mp ev-mp merged commit 92edc19 into IntelRealSense:D4XX_MIPI Aug 21, 2022
@remibettan remibettan deleted the D4XX_y16_crash_temp_fix branch July 29, 2025 14:05
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

Successfully merging this pull request may close these issues.

2 participants