From b58bb67516ceaa2de0fef6fc73156b3da877fd7f Mon Sep 17 00:00:00 2001 From: Sebastian Annies Date: Wed, 6 Aug 2014 15:51:56 +0200 Subject: [PATCH] allow all 1s for trackheader's duration field to support unknown duration. --- .../main/java/com/coremedia/iso/boxes/TrackHeaderBox.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/TrackHeaderBox.java b/isoparser/src/main/java/com/coremedia/iso/boxes/TrackHeaderBox.java index 3985cd255..38421f9c8 100644 --- a/isoparser/src/main/java/com/coremedia/iso/boxes/TrackHeaderBox.java +++ b/isoparser/src/main/java/com/coremedia/iso/boxes/TrackHeaderBox.java @@ -116,7 +116,11 @@ public void _parseDetails(ByteBuffer content) { modificationTime = DateHelper.convert(IsoTypeReader.readUInt64(content)); trackId = IsoTypeReader.readUInt32(content); IsoTypeReader.readUInt32(content); - duration = IsoTypeReader.readUInt64(content); + duration = content.getLong(); + if (duration < -1) { + throw new RuntimeException("The tracks duration is bigger than Long.MAX_VALUE"); + } + } else { creationTime = DateHelper.convert(IsoTypeReader.readUInt32(content)); modificationTime = DateHelper.convert(IsoTypeReader.readUInt32(content));