-
Notifications
You must be signed in to change notification settings - Fork 617
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
don't index empty array in testMultiPartSharedAttributes #443
don't index empty array in testMultiPartSharedAttributes #443
Conversation
@@ -152,7 +152,7 @@ testMultiPartOutputFileForExpectedFailure (const vector<Header> & headers, | |||
try | |||
{ | |||
remove(fn.c_str()); | |||
MultiPartOutputFile file(fn.c_str(), &headers[0],headers.size()); | |||
MultiPartOutputFile file(fn.c_str(), (headers.size()>0 ? &headers[0] : NULL) , headers.size() ); |
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.
Wouldn't header.data() be a more proper way of accessing the data?
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.
Yes it would, but is vector::data() available in all C++ versions that are supported by OpenEXR?
The docs say C++11, and that's what we're relying on now, so it should be
fine.
…On Tue, Jul 16, 2019 at 2:54 PM peterhillman ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In OpenEXR/IlmImfTest/testMultiPartSharedAttributes.cpp
<#443 (comment)>:
> @@ -152,7 +152,7 @@ testMultiPartOutputFileForExpectedFailure (const vector<Header> & headers,
try
{
remove(fn.c_str());
- MultiPartOutputFile file(fn.c_str(), &headers[0],headers.size());
+ MultiPartOutputFile file(fn.c_str(), (headers.size()>0 ? &headers[0] : NULL) , headers.size() );
Yes it would, but is vector::data() available in all C++ versions that are
supported by OpenEXR?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#443>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFC3DGO2WJJM4QZ3BLJSL43P7Y7TFANCNFSM4ID6JDNA>
.
--
Cary Phillips | R&D Supervisor | ILM | San Francisco
|
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 w/ .data()
Fix for #377