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

Fix Coverity issues #12465

Merged

Conversation

Tamir91
Copy link
Contributor

@Tamir91 Tamir91 commented Dec 3, 2023

No description provided.

@Tamir91 Tamir91 requested a review from OhadMeir December 3, 2023 07:02
@OhadMeir
Copy link
Contributor

OhadMeir commented Dec 3, 2023

Please add "Coverity issues" to the PR title not just numbers. It does not have to include the numbers in the title, can have them in the description.
Also commit message that is just a number is not verbose enough, we won't remember it's a Coverity issue number afterwards.

auto st = p->get_stream_type();

Copy link
Contributor

Choose a reason for hiding this comment

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

Better to perform the check immediately after the cast.

  1. locality - easier to see the connection
  2. efficiency - not performing needless operation in case of failure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will learn it. Fixed.

@@ -77,6 +77,10 @@ namespace librealsense
auto gf = dynamic_cast<gpu_addon_interface*>((frame_interface*)new_f.get());

uint32_t output_yuv;

Copy link
Contributor

Choose a reason for hiding this comment

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

Same, success checks should be right after the action.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed too.

Copy link
Contributor

@OhadMeir OhadMeir left a comment

Choose a reason for hiding this comment

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

Looks great, just some minor comments :-)

@Tamir91 Tamir91 changed the title 3689122 3784249 3413520 3413504 Fix Coverity issues Dec 3, 2023
@Tamir91 Tamir91 requested a review from OhadMeir December 3, 2023 11:24
@OhadMeir OhadMeir merged commit c918402 into IntelRealSense:development Dec 3, 2023
15 of 16 checks passed
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