File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -853,7 +853,7 @@ struct SingleItemTypeReferenceBox {
853
853
854
854
/// Potential sizes (in bytes) of variable-sized fields of the 'iloc' box
855
855
/// See ISOBMFF (ISO 14496-12:2015) § 8.11.3
856
- #[ derive( Debug ) ]
856
+ #[ derive( Debug , Clone , Copy , PartialEq ) ]
857
857
enum IlocFieldSize {
858
858
Zero ,
859
859
Four ,
@@ -1973,6 +1973,16 @@ fn read_iloc<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<ItemLocationBoxItem
1973
1973
) ) ;
1974
1974
}
1975
1975
1976
+ // "If only one extent is used (extent_count = 1) then either or both of the
1977
+ // offset and length may be implied"
1978
+ if extent_count != 1
1979
+ && ( offset_size == IlocFieldSize :: Zero || length_size == IlocFieldSize :: Zero )
1980
+ {
1981
+ return Err ( Error :: InvalidData (
1982
+ "extent_count != 1 requires explicit offset and length per ISOBMFF (ISO 14496-12:2015) § 8.11.3.3" ,
1983
+ ) ) ;
1984
+ }
1985
+
1976
1986
let mut extents = TryVec :: with_capacity ( extent_count. to_usize ( ) ) ?;
1977
1987
1978
1988
for _ in 0 ..extent_count {
You can’t perform that action at this time.
0 commit comments