diff --git a/src/parsing/cmpd.js b/src/parsing/cmpd.js index e2db3e9d..edd195c0 100644 --- a/src/parsing/cmpd.js +++ b/src/parsing/cmpd.js @@ -3,7 +3,7 @@ BoxParser.createBoxCtor("cmpd", function(stream) { this.component_types = []; this.component_type_urls = []; for (i = 0; i < this.component_count; i++) { - var component_type = stream.readUint16(); + var component_type = stream.readUint32(); this.component_types.push(component_type); if (component_type >= 0x8000) { this.component_type_urls.push(stream.readCString()); diff --git a/src/parsing/uncC.js b/src/parsing/uncC.js index f3834c25..18ad6754 100644 --- a/src/parsing/uncC.js +++ b/src/parsing/uncC.js @@ -1,30 +1,34 @@ BoxParser.createFullBoxCtor("uncC", function(stream) { var i; this.profile = stream.readUint32(); - this.component_count = stream.readUint16(); - this.component_index = []; - this.component_bit_depth_minus_one = []; - this.component_format = []; - this.component_align_size = []; - for (i = 0; i < this.component_count; i++) { - this.component_index.push(stream.readUint16()); - this.component_bit_depth_minus_one.push(stream.readUint8()); - this.component_format.push(stream.readUint8()); - this.component_align_size.push(stream.readUint8()); + if (this.version == 1) { + // Nothing - just the profile + } else if (this.version == 0) { + this.component_count = stream.readUint32(); + this.component_index = []; + this.component_bit_depth_minus_one = []; + this.component_format = []; + this.component_align_size = []; + for (i = 0; i < this.component_count; i++) { + this.component_index.push(stream.readUint16()); + this.component_bit_depth_minus_one.push(stream.readUint8()); + this.component_format.push(stream.readUint8()); + this.component_align_size.push(stream.readUint8()); + } + this.sampling_type = stream.readUint8(); + this.interleave_type = stream.readUint8(); + this.block_size = stream.readUint8(); + var flags = stream.readUint8(); + this.component_little_endian = (flags >> 7) & 0x1; + this.block_pad_lsb = (flags >> 6) & 0x1; + this.block_little_endian = (flags >> 5) & 0x1; + this.block_reversed = (flags >> 4) & 0x1; + this.pad_unknown = (flags >> 3) & 0x1; + this.pixel_size = stream.readUint32(); + this.row_align_size = stream.readUint32(); + this.tile_align_size = stream.readUint32(); + this.num_tile_cols_minus_one = stream.readUint32(); + this.num_tile_rows_minus_one = stream.readUint32(); } - this.sampling_type = stream.readUint8(); - this.interleave_type = stream.readUint8(); - this.block_size = stream.readUint8(); - var flags = stream.readUint8(); - this.component_little_endian = (flags >> 7) & 0x1; - this.block_pad_lsb = (flags >> 6) & 0x1; - this.block_little_endian = (flags >> 5) & 0x1; - this.block_reversed = (flags >> 4) & 0x1; - this.pad_unknown = (flags >> 3) & 0x1; - this.pixel_size = stream.readUint8(); - this.row_align_size = stream.readUint32(); - this.tile_align_size = stream.readUint32(); - this.num_tile_cols_minus_one = stream.readUint32(); - this.num_tile_rows_minus_one = stream.readUint32(); });