diff --git a/src/isobmff/isobmff-demuxer.ts b/src/isobmff/isobmff-demuxer.ts index d4d08d3..4161791 100644 --- a/src/isobmff/isobmff-demuxer.ts +++ b/src/isobmff/isobmff-demuxer.ts @@ -2263,7 +2263,7 @@ const getSampleInfo = (sampleTable: SampleTable, sampleIndex: number): SampleInf x => x.startIndex, ); const offsetEntry = sampleTable.sampleCompositionTimeOffsets[offsetEntryIndex]; - if (offsetEntry) { + if (offsetEntry && sampleIndex - offsetEntry.startIndex < offsetEntry.count) { presentationTimestamp += offsetEntry.offset; }