Skip to content

Fix null pointer dereference in Composable::available_image_bounds - #2055

Open
La1itchauhan wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
La1itchauhan:fix/issue-2045-available-image-bounds
Open

La1itchauhan wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
La1itchauhan:fix/issue-2045-available-image-bounds

Conversation

@La1itchauhan

@La1itchauhan La1itchauhan commented Sep 19, 2026

Copy link
Copy Markdown

Fixes #2045

Composable::available_image_bounds(ErrorStatus* error_status) was writing directly to *error_status without checking if the pointer was null. Because error_status defaults to nullptr, calling available_image_bounds() on Composable or derived classes that do not override it (such as Gap and Transition) caused a segmentation fault.

  • Added a null check before writing ErrorStatus::NOT_IMPLEMENTED to *error_status, consistent with Composable::duration.
  • Resolves the crash for all non-overriding subclasses (including Gap and Transition) inheriting the base implementation.

Reference associated tests.

  • Added test_composable_available_image_bounds in tests/test_composition.cpp verifying that calls with default nullptr and explicit nullptr do not crash, and that passing an ErrorStatus pointer correctly reports NOT_IMPLEMENTED.
  • Added test_available_image_bounds in tests/test_item.py to cover the Python bindings.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 19, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: La1itchauhan / name: La1itchauhan (2b0b748)

@La1itchauhan
La1itchauhan force-pushed the fix/issue-2045-available-image-bounds branch from 0ee2819 to 2b0b748 Compare September 19, 2026 18:55
@codecov-commenter

codecov-commenter commented Sep 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.55%. Comparing base (696150b) to head (7e07199).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2055      +/-   ##
==========================================
+ Coverage   83.52%   83.55%   +0.02%     
==========================================
  Files         182      182              
  Lines       13533    13538       +5     
  Branches     1255     1256       +1     
==========================================
+ Hits        11303    11311       +8     
+ Misses       2057     2054       -3     
  Partials      173      173              
Flag Coverage Δ
py-unittests 83.55% <100.00%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
src/opentimelineio/composable.cpp 67.74% <100.00%> (+11.07%) ⬆️
tests/test_item.py 98.69% <100.00%> (+0.03%) ⬆️

Continue to review full report in Codecov by Harness.

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

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

@La1itchauhan
La1itchauhan force-pushed the fix/issue-2045-available-image-bounds branch from 2b0b748 to b8de01f Compare September 19, 2026 19:01
@La1itchauhan
La1itchauhan marked this pull request as draft September 19, 2026 19:06
Composable::available_image_bounds writes to *error_status without checking whether the pointer is non-null. Because error_status defaults to nullptr, calling available_image_bounds() on any Composable or subclass that does not override it (such as Gap) causes a crash.

Added a null check before assigning *error_status, and added unit tests in both C++ (tests/test_composition.cpp) and Python (tests/test_item.py) verifying that calls with default nullptr and explicit nullptr do not crash, and calls with valid error_status report NOT_IMPLEMENTED.

Fixes AcademySoftwareFoundation#2045.

Signed-off-by: La1itchauhan <chauhanlalitofficial@gmail.com>
@La1itchauhan
La1itchauhan force-pushed the fix/issue-2045-available-image-bounds branch from b8de01f to 7e07199 Compare September 19, 2026 19:07
@La1itchauhan
La1itchauhan marked this pull request as ready for review September 19, 2026 19:13
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.

Crash in available_image_bounds error code path

2 participants