Track::range_of_all_children silently skips a child that is neither an Item nor a Transition, so child_at_time returns nothing and no error
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 64/100
Línea de trabajo
Start by reading the Track::range_of_all_children() loop in src/opentimelineio/track.cpp (lines 221-271) against Track::range_of_child_at_index() and Composable::duration() in composable.cpp, which already reports OBJECT_WITHOUT_DURATION. Reproduce with the supplied C++ program, then decide and implement consistent behavior: either propagate an error for the plain Composable, or make child_at_time() return the covering Gap. Add a regression test covering the three-child track and confirm it fails before the fix and passes after.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Required:
[x] I believe this isn't a duplicate topic
[x] This report is not related to an adapter
Select One:
[ ] Build problem
[x] Incorrect Functionality or bug
[ ] New feature or functionality
Description
A Track whose children are a 24-frame Gap, a plain Composable, and another 24-frame Gap loads without error. On that track:
range_of_all_children()returns 2 entries for 3 children and no error;child_at_time(RationalTime(12, 24))returns no child and no error, although the first Gap covers frames 0 to 24.
The documentation allows any Composable as a Track child (otio-timeline-structure.md, line 156): "The children of a Track can be any Composable object", and Composable has a public constructor in C++ and Python. child_at_time is documented as (composition.h, line 137):
/// @brief Return the child that overlaps with the given time.
For the same kind of child, the sibling function Track::range_of_child_at_index() reports an error: it calls child->duration(error_status) (track.cpp, lines 64-69), and Composable::duration() sets OBJECT_WITHOUT_DURATION, "Cannot determine duration from this kind of object" (composable.cpp, lines 64-75). Stack::range_of_all_children() goes through the same call (stack.cpp, lines 64-80).
Expected: either range_of_all_children() (and so child_at_time()) reports an error such as OBJECT_WITHOUT_DURATION, as range_of_child_at_index() does for this child, or child_at_time(12@24) returns the first Gap. A null result with no error looks wrong in both readings. If a plain Composable is not meant to be a Track child, an error on load or insert would also make that clear.
Suggestion for the cause: the loop in Track::range_of_all_children() (track.cpp, lines 221-271) only handles Transition and Item, with no else, so any other child gets no map entry and no error. child_at_time() then reads range_map[child], which creates an empty 0-to-0 range for that child and breaks the sorted search (composition.cpp, lines 504-546).
Reproduction Steps
Build against the C++ library (opentimelineio) and run. The program writes the track to a small .otio JSON file, loads it with SerializableObject::from_json_file, then queries it.
#include <opentimelineio/composition.h>
#include <opentimelineio/gap.h>
#include <opentimelineio/serializableObject.h>
#include <opentimelineio/track.h>
#include <opentimelineio/version.h>
#include <cstdio>
#include <cstring>
using namespace OTIO_NS;
using OTIOError = OTIO_NS::ErrorStatus;
// Track: Gap [0,24)@24, a plain Composable, Gap [0,24)@24
static const char* JSON =
"{\"OTIO_SCHEMA\":\"Track.1\",\"children\":["
"{\"OTIO_SCHEMA\":\"Gap.1\",\"source_range\":{\"OTIO_SCHEMA\":\"TimeRange.1\","
"\"start_time\":{\"OTIO_SCHEMA\":\"RationalTime.1\",\"rate\":24,\"value\":0},"
"\"duration\":{\"OTIO_SCHEMA\":\"RationalTime.1\",\"rate\":24,\"value\":24}}},"
"{\"OTIO_SCHEMA\":\"Composable.1\"},"
"{\"OTIO_SCHEMA\":\"Gap.1\",\"source_range\":{\"OTIO_SCHEMA\":\"TimeRange.1\","
"\"start_time\":{\"OTIO_SCHEMA\":\"RationalTime.1\",\"rate\":24,\"value\":0},"
"\"duration\":{\"OTIO_SCHEMA\":\"RationalTime.1\",\"rate\":24,\"value\":24}}}],"
"\"kind\":\"Video\"}";
int
main()
{
const char* path = "bad_track.json";
if (FILE* f = fopen(path, "wb"))
{
fwrite(JSON, 1, strlen(JSON), f);
fclose(f);
}
else
{
printf("SETUP-FAIL cannot write %s\n", path);
return 2;
}
OTIOError pe;
SerializableObject* so = SerializableObject::from_json_file(path, &pe);
if (is_error(pe) || !so)
{
printf("SETUP-FAIL from_json_file: %s\n", pe.full_description.c_str());
return 2;
}
Track* t = dynamic_cast<Track*>(so);
if (!t)
{
printf("SETUP-FAIL not a Track\n");
return 2;
}
printf(
"loaded %s: Track with %zu children, load errors=%d\n",
path,
t->children().size(),
(int) is_error(pe));
OTIOError re;
auto m = t->range_of_all_children(&re);
printf(
"range_of_all_children: entries=%zu of %zu children, error=%d (%s)\n",
m.size(),
t->children().size(),
(int) is_error(re),
re.full_description.c_str());
OTIOError ce;
auto c = t->child_at_time(RationalTime(12, 24), &ce);
printf(
"child_at_time(12@24) -> child=%s error=%d (%s)\n",
c.value ? c.value->schema_name().c_str() : "null",
(int) is_error(ce),
ce.full_description.c_str());
// the first child is a Gap spanning [0,24)@24, which contains 12@24
bool first_is_gap = dynamic_cast<Gap*>(t->children()[0].value) != nullptr;
if (!c.value && !is_error(ce))
{
printf(
"FAIL: file-driven child_at_time(12@24) returned no child and no error, though children[0] is a Gap (=%d) spanning [0,24)@24 which contains 12@24\n",
(int) first_is_gap);
return 1;
}
printf("ok\n");
return 0;
}
The same happens with a track built in code (insert_child of a Gap, new Composable(), a Gap): child_at_time(12@24) returns no child and no error, while the same track with only the two Gaps returns the first Gap.
Log output if appropriate
Observed:
loaded bad_track.json: Track with 3 children, load errors=0
range_of_all_children: entries=2 of 3 children, error=0 ()
child_at_time(12@24) -> child=null error=0 ()
FAIL: file-driven child_at_time(12@24) returned no child and no error, though children[0] is a Gap (=1) spanning [0,24)@24 which contains 12@24
Expected: either an error is reported (error=1, for example OBJECT_WITHOUT_DURATION) by range_of_all_children and child_at_time, or child_at_time(12@24) returns the first Gap and the program prints ok.
Optional
Environment
OpenTimelineIO main at bad7ab5a40ac1a95d9d78a87c95a688d8b57cf28, and run again at f6c34bc6c3337cdd27db77c983c6074130c1c91c (20 Nov 2026) with the same result, C++ library opentimelineio.
Operating System: Windows, MSVC (Visual Studio 2022 Build Tools), the project's CMake build in Debug configuration with AddressSanitizer (/fsanitize=address).
Python version if appropriate: n/a (C++ API).
Found by VaultLens, an analysis tool that uses AI to catch bugs. If anything is wrong, please let us know.
- Lenguaje dominante
- C++
- Estrellas
- 2.1k
- Forks
- 367
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AcademySoftwareFoundation/OpenTimelineIO
-
RationalTime::to_time_string gives a malformed or wrong string when the fractional second is below 0.0001Posiblemente ocupada @SoulmatelynchVFX la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
AcademySoftwareFoundation/OpenTimelineIO#2107 ·
Los mantenedores suelen responder en 1 día
-
RationalTime::from_time_string rejects any time string with a leading '-', including the output of to_time_stringPosiblemente ocupada @kolinabir la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AcademySoftwareFoundation/OpenTimelineIO#2106 ·
Los mantenedores suelen responder en 1 día
-
otio_imath.cpp fails to compile with the latest Imath/pybind11Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
AcademySoftwareFoundation/OpenTimelineIO#2037 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
AcademySoftwareFoundation/OpenTimelineIO#2098 ·
Los mantenedores suelen responder en 1 día
-
Rust bindings?Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
AcademySoftwareFoundation/OpenTimelineIO#2093 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de AcademySoftwareFoundation/OpenTimelineIO
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mw00/project-maya#1368 ·
Los mantenedores suelen responder en 2 días
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[LLK][QSR][PERF] eltwise_binary: perf harness INIT enables direct indexing, production does notAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
tenstorrent/tt-metal#67662 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
maplibre/maplibre-native#5159 ·
Los mantenedores suelen responder en 1 día
-
enhancement question
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
lbr-stack/lbr_fri_ros2_stack#420 · 1 comentario ·