-
Notifications
You must be signed in to change notification settings - Fork 607
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 #4349
Fix coverity issues #4349
Conversation
Signed-off-by: Rafal <rbanas@nvidia.com>
CI MESSAGE: [6171593]: BUILD STARTED |
CI MESSAGE: [6171593]: BUILD PASSED |
CI MESSAGE: [6180197]: BUILD STARTED |
dali/imgcodec/util/convert.cc
Outdated
DALI_ENFORCE(in_layout.find('H') >= 0 && in_layout.find('W') >= 0, | ||
"Input layout has to contain at least H and W dimensions."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: technically, there's no such requirement for the input layout (it could be **C
or whatever).
dali/imgcodec/util/convert.cc
Outdated
DALI_ENFORCE(out_layout.find('H') >= 0 && out_layout.find('W') >= 0, | ||
"Output layout has to contain at least H and W dimensions."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess at this point it should be:
DALI_ENFORCE(out_layout.find('H') >= 0 && out_layout.find('W') >= 0, | |
"Output layout has to contain at least H and W dimensions."); | |
int h_dim = ImageLayoutInfo::DimIndex(out_layout, 'H'); | |
int w_dim = ImageLayoutInfo::DimIndex(out_layout, 'W'); | |
DALI_ENFORCE(h_dim >= 0 && w_dim >= 0, | |
"Output layout has to contain at least H and W dimensions."); |
...and you could remove the
auto h_dim = ImageLayoutInfo::DimIndex(out_layout, 'H');
auto w_dim = ImageLayoutInfo::DimIndex(out_layout, 'W');
from the TYPE_SWITCH below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with some minor remarks
CI MESSAGE: [6180197]: BUILD PASSED |
Signed-off-by: Rafal <rbanas@nvidia.com>
CI MESSAGE: [6181826]: BUILD STARTED |
CI MESSAGE: [6181826]: BUILD PASSED |
Signed-off-by: Rafal rbanas@nvidia.com
Category:
Bug fix
Description:
It fixes issues found by coverity
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A