Skip to content

Commit

Permalink
Merge pull request #44 from cchanley2003/last-box-fix
Browse files Browse the repository at this point in the history
Account for last box in file being a child box
  • Loading branch information
bbert authored Feb 16, 2023
2 parents 709085c + 77c977e commit 49c05a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/iso_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ ISOBox.prototype._parseBox = function() {

switch(this.size) {
case 0:
this._raw = new DataView(this._raw.buffer, this._offset, (this._raw.byteLength - this._cursor.offset + 8));
// Size zero indicates last box in the file. Consume remaining buffer.
this._raw = new DataView(this._raw.buffer, this._offset);
break;
case 1:
if (this._offset + this.size > this._raw.buffer.byteLength) {
Expand Down

0 comments on commit 49c05a3

Please sign in to comment.