Skip to content

Fix Coverity issues#12465

Merged
OhadMeir merged 6 commits into
realsenseai:developmentfrom
Tamir91:coverity-development-validation
Dec 3, 2023
Merged

Fix Coverity issues#12465
OhadMeir merged 6 commits into
realsenseai:developmentfrom
Tamir91:coverity-development-validation

Conversation

@Tamir91

@Tamir91 Tamir91 commented Dec 3, 2023

Copy link
Copy Markdown
Contributor

No description provided.

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

OhadMeir commented Dec 3, 2023

Copy link
Copy Markdown
Contributor

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.

Comment thread src/ds/ds-motion-common.cpp Outdated
auto motion = dynamic_cast<motion_stream_profile_interface*>(p.get());
assert(motion);
auto st = p->get_stream_type();

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/gl/upload.cpp Outdated
auto gf = dynamic_cast<gpu_addon_interface*>((frame_interface*)new_f.get());

uint32_t output_yuv;

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed too.

@OhadMeir OhadMeir left a comment

Copy link
Copy Markdown
Contributor

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 realsenseai:development Dec 3, 2023
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