Skip to content

Conversation

@cato-o
Copy link
Contributor

@cato-o cato-o commented Jun 6, 2025

Summarize your change.

Added null pointer check for the error status pointer in the available image bounds function.

Reference associated tests.
Added two new test cases to test_clip.cpp called "test_error_ptr_null" and "test_error_ptr_null_no_media". One test has a media reference, the other test has no media reference.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 6, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 84.79%. Comparing base (c0e97b0) to head (f5787b6).
Report is 57 commits behind head on main.

Files with missing lines Patch % Lines
src/opentimelineio/clip.cpp 0.00% 6 Missing ⚠️

❌ Your changes status has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1896      +/-   ##
==========================================
+ Coverage   84.11%   84.79%   +0.67%     
==========================================
  Files         198      177      -21     
  Lines       22241    12791    -9450     
  Branches     4687     1193    -3494     
==========================================
- Hits        18709    10846    -7863     
+ Misses       2610     1762     -848     
+ Partials      922      183     -739     
Flag Coverage Δ
py-unittests 84.79% <0.00%> (+0.67%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/opentimelineio/composable.h 100.00% <ø> (ø)
src/opentimelineio/clip.cpp 85.54% <0.00%> (+9.90%) ⬆️

... and 135 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8405a57...f5787b6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cato-o added 3 commits June 9, 2025 14:35
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
@darbyjohnston
Copy link
Contributor

Hi, and thanks for the fix!

It would also be nice to fix the available_image_bounds() function declarations, it looks like they are missing the default nullptr value. We generally default the error_status argument to nullptr so there is a bit less code to write if the developer does not want to check the error status.

It looks like the declarations need to be fixed in clip.h and composable.h, just by changing:

std::optional<IMATH_NAMESPACE::Box2d>
    available_image_bounds(ErrorStatus* error_status) const;

To:

std::optional<IMATH_NAMESPACE::Box2d>
    available_image_bounds(ErrorStatus* error_status = nullptr) const;

cato-o added 3 commits June 12, 2025 09:49
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
@cato-o
Copy link
Contributor Author

cato-o commented Jun 13, 2025

Hi Darby! I made the changes you mentioned and it's ready for re-review! Thank you :)

@darbyjohnston
Copy link
Contributor

Thanks for the changes! Just one more small change and I think it is ready; in the second test, you could use new to create the clip since you are setting the media references to empty:

SerializableObject::Retainer<Clip> clip(new Clip);

Or keep the JSON and remove the part about setting the media references to empty, they both do the same thing and only one is needed.

cato-o added 2 commits June 16, 2025 14:28
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
Signed-off-by: Yingjie Wang <yingjiew@pixar.com>
@darbyjohnston
Copy link
Contributor

Looks good, thanks again!

@darbyjohnston darbyjohnston added the bug A problem, flaw, or broken functionality. label Jun 17, 2025
@darbyjohnston darbyjohnston added this to the Public Beta 18 milestone Jun 17, 2025
@darbyjohnston darbyjohnston merged commit bacf095 into AcademySoftwareFoundation:main Jun 17, 2025
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A problem, flaw, or broken functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants