Skip to content

Draft: Fix null pointer dereferences after dynamic_cast#2017

Open
jminor wants to merge 3 commits intoAcademySoftwareFoundation:mainfrom
jminor:fix-null-ptr-deref2
Open

Draft: Fix null pointer dereferences after dynamic_cast#2017
jminor wants to merge 3 commits intoAcademySoftwareFoundation:mainfrom
jminor:fix-null-ptr-deref2

Conversation

@jminor
Copy link
Copy Markdown
Collaborator

@jminor jminor commented Apr 27, 2026

Certain invalid OTIO object graphs with cycles may cause crashes due to code that assumes a dynamic_cast always returns a valid object. This PR introduces tests which demonstrate the issue and a fix to prevent the crash in those cases.

Note that the discovery of this issue and portions of the test code and fix were assisted by Claude Code Opus 4.6 and Opus 4.7. Since OTIO's policy on LLM use is still in discussion, this PR is marked as a draft.

jminor added 3 commits April 26, 2026 21:08
Assisted-by: Claude Code / Opus 4.7
Assisted-by: Claude Code / Opus 4.7

Note: Claude Code Opus 4.6 was used to find this bug, and Opus 4.7 was
used to fix it.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.01%. Comparing base (6e13de4) to head (cff8450).

Files with missing lines Patch % Lines
src/opentimelineio/algo/editAlgorithm.cpp 0.00% 21 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2017      +/-   ##
==========================================
- Coverage   85.14%   85.01%   -0.14%     
==========================================
  Files         181      181              
  Lines       12780    12800      +20     
  Branches     1206     1214       +8     
==========================================
  Hits        10882    10882              
- Misses       1715     1735      +20     
  Partials      183      183              
Flag Coverage Δ
py-unittests 85.01% <0.00%> (-0.14%) ⬇️

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

Files with missing lines Coverage Δ
src/opentimelineio/algo/editAlgorithm.cpp 0.00% <0.00%> (ø)

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 6e13de4...cff8450. Read the comment docs.

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

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