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));