@@ -1953,6 +1953,7 @@ fn read_stbl<T: Read>(f: &mut BMFFBox<T>, track: &mut Track) -> Result<()> {
1953
1953
}
1954
1954
1955
1955
/// Parse an ftyp box.
1956
+ /// See ISO 14496-12:2015 § 4.3
1956
1957
fn read_ftyp < T : Read > ( src : & mut BMFFBox < T > ) -> Result < FileTypeBox > {
1957
1958
let major = be_u32 ( src) ?;
1958
1959
let minor = be_u32 ( src) ?;
@@ -2421,7 +2422,7 @@ fn find_descriptor(data: &[u8], esds: &mut ES_Descriptor) -> Result<()> {
2421
2422
let des = & mut Cursor :: new ( remains) ;
2422
2423
let tag = des. read_u8 ( ) ?;
2423
2424
2424
- // See ISO 14496-1:2010 § 8.3.3 for interpreting size of exandable classes
2425
+ // See ISO 14496-1:2010 § 8.3.3 for interpreting size of expandable classes
2425
2426
2426
2427
let mut end: u32 = 0 ; // It's u8 without declaration type that is incorrect.
2427
2428
// MSB of extend_or_len indicates more bytes, up to 4 bytes.
@@ -2627,7 +2628,11 @@ fn read_ds_descriptor(data: &[u8], esds: &mut ES_Descriptor) -> Result<()> {
2627
2628
esds. extended_audio_object_type = extended_audio_object_type;
2628
2629
esds. audio_sample_rate = Some ( sample_frequency_value) ;
2629
2630
esds. audio_channel_count = Some ( channel_counts) ;
2630
- assert ! ( esds. decoder_specific_data. is_empty( ) ) ;
2631
+ if !esds. decoder_specific_data . is_empty ( ) {
2632
+ return Err ( Error :: InvalidData (
2633
+ "There can be only one DecSpecificInfoTag descriptor" ,
2634
+ ) ) ;
2635
+ }
2631
2636
esds. decoder_specific_data . extend_from_slice ( data) ?;
2632
2637
2633
2638
Ok ( ( ) )
0 commit comments