@@ -802,57 +802,8 @@ fn read_alac() {
802802 assert ! ( r. is_ok( ) ) ;
803803}
804804
805- #[ test]
806- fn avcc_limit ( ) {
807- let mut stream = make_box ( BoxSize :: Auto , b"avc1" , |s| {
808- s. append_repeated ( 0 , 6 )
809- . B16 ( 1 )
810- . append_repeated ( 0 , 16 )
811- . B16 ( 320 )
812- . B16 ( 240 )
813- . append_repeated ( 0 , 14 )
814- . append_repeated ( 0 , 32 )
815- . append_repeated ( 0 , 4 )
816- . B32 ( 0xffff_ffff )
817- . append_bytes ( b"avcC" )
818- . append_repeated ( 0 , 100 )
819- } ) ;
820- let mut iter = super :: BoxIter :: new ( & mut stream) ;
821- let mut stream = iter. next_box ( ) . unwrap ( ) . unwrap ( ) ;
822- match super :: read_video_sample_entry ( & mut stream) {
823- Err ( Error :: InvalidData ( s) ) => assert_eq ! ( s, "read_buf size exceeds BUF_SIZE_LIMIT" ) ,
824- Ok ( _) => panic ! ( "expected an error result" ) ,
825- _ => panic ! ( "expected a different error result" ) ,
826- }
827- }
828-
829805#[ test]
830806fn esds_limit ( ) {
831- let mut stream = make_box ( BoxSize :: Auto , b"mp4a" , |s| {
832- s. append_repeated ( 0 , 6 )
833- . B16 ( 1 )
834- . B32 ( 0 )
835- . B32 ( 0 )
836- . B16 ( 2 )
837- . B16 ( 16 )
838- . B16 ( 0 )
839- . B16 ( 0 )
840- . B32 ( 48000 << 16 )
841- . B32 ( 0xffff_ffff )
842- . append_bytes ( b"esds" )
843- . append_repeated ( 0 , 100 )
844- } ) ;
845- let mut iter = super :: BoxIter :: new ( & mut stream) ;
846- let mut stream = iter. next_box ( ) . unwrap ( ) . unwrap ( ) ;
847- match super :: read_audio_sample_entry ( & mut stream) {
848- Err ( Error :: InvalidData ( s) ) => assert_eq ! ( s, "read_buf size exceeds BUF_SIZE_LIMIT" ) ,
849- Ok ( _) => panic ! ( "expected an error result" ) ,
850- _ => panic ! ( "expected a different error result" ) ,
851- }
852- }
853-
854- #[ test]
855- fn esds_limit_2 ( ) {
856807 let mut stream = make_box ( BoxSize :: Auto , b"mp4a" , |s| {
857808 s. append_repeated ( 0 , 6 )
858809 . B16 ( 1 )
@@ -1305,25 +1256,6 @@ fn read_esds_redundant_descriptor() {
13051256 }
13061257}
13071258
1308- #[ test]
1309- fn read_invalid_pssh ( ) {
1310- // invalid pssh header length
1311- let pssh = vec ! [
1312- 0x00 , 0x00 , 0x00 , 0x01 , 0x70 , 0x73 , 0x73 , 0x68 , 0x01 , 0x00 , 0x00 , 0x00 , 0x10 , 0x77 , 0xef ,
1313- 0xec , 0xc0 , 0xb2 , 0x4d , 0x02 , 0xac , 0xe3 , 0x3c , 0x1e , 0x52 , 0xe2 , 0xfb , 0x4b , 0x00 , 0x00 ,
1314- 0x00 , 0x02 , 0x7e , 0x57 , 0x1d , 0x01 , 0x7e ,
1315- ] ;
1316-
1317- let mut stream = make_box ( BoxSize :: Auto , b"moov" , |s| s. append_bytes ( pssh. as_slice ( ) ) ) ;
1318- let mut iter = super :: BoxIter :: new ( & mut stream) ;
1319- let mut stream = iter. next_box ( ) . unwrap ( ) . unwrap ( ) ;
1320-
1321- match super :: read_moov ( & mut stream, None ) {
1322- Err ( Error :: InvalidData ( s) ) => assert_eq ! ( s, "read_buf size exceeds BUF_SIZE_LIMIT" ) ,
1323- _ => panic ! ( "unexpected result with invalid descriptor" ) ,
1324- }
1325- }
1326-
13271259#[ test]
13281260fn read_stsd_lpcm ( ) {
13291261 // Extract from sample converted by ffmpeg.
0 commit comments