Skip to content

Commit

Permalink
#1680 fix segmentation fault when appending None (#1778)
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Magnusson <[email protected]>
  • Loading branch information
semagnum committed Jul 17, 2024
1 parent 5dff8be commit ec2bc15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ Should be subclassed (for example by :class:`.Track` and :class:`.Stack`), not u
index = adjusted_vector_index(index, c->children());
c->remove_child(index, ErrorStatusHandler());
}, "index"_a)
.def("__internal_insert", [](Composition* c, int index, Composable* composable) {
.def("__internal_insert", [](Composition* c, int index, Composable &composable) {
index = adjusted_vector_index(index, c->children());
c->insert_child(index, composable, ErrorStatusHandler());
c->insert_child(index, &composable, ErrorStatusHandler());
}, "index"_a, "item"_a)
.def("__contains__", &Composition::has_child, "composable"_a)
.def("__len__", [](Composition* c) {
Expand Down
4 changes: 4 additions & 0 deletions tests/test_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

class TrackTests(unittest.TestCase, otio_test_utils.OTIOAssertions):

def test_append_none(self):
tr = otio.schema.Track()
self.assertRaises(TypeError, lambda x: tr.append(None))

def test_find_children(self):
cl = otio.schema.Clip()
tr = otio.schema.Track()
Expand Down

0 comments on commit ec2bc15

Please sign in to comment.