File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 2121 steps :
2222 - uses : actions/checkout@v2
2323 - name : Dependencies
24- run : sudo apt-get update && sudo apt-get install -y ffmpeg # Need ffprobe for issue #37
24+ - run : sudo apt-get update && sudo apt-get install -y ffmpeg # Need ffprobe for issue #37
25+ - run : sudo apt-get install -y opus-tools # Need opusinfo for issue #130
2526 - uses : actions-rs/toolchain@v1
2627 with :
2728 profile : minimal
Original file line number Diff line number Diff line change @@ -689,6 +689,35 @@ mod tests {
689689 ) ;
690690 }
691691
692+ #[ test]
693+ fn issue_130_huge_picture ( ) {
694+ let file_contents = read_path ( "tests/files/assets/minimal/full_test.opus" ) ;
695+ let mut temp_file = tempfile:: NamedTempFile :: new ( ) . unwrap ( ) ;
696+ temp_file. write_all ( & file_contents) . unwrap ( ) ;
697+ temp_file. rewind ( ) . unwrap ( ) ;
698+
699+ let mut tag = Tag :: new ( TagType :: VorbisComments ) ;
700+
701+ // 81KB picture, which is big enough to surpass the maximum page size
702+ let mut picture =
703+ Picture :: from_reader ( & mut & * read_path ( "tests/files/assets/issue_37.jpg" ) ) . unwrap ( ) ;
704+ picture. set_pic_type ( PictureType :: CoverFront ) ;
705+
706+ tag. push_picture ( picture) ;
707+ tag. save_to ( temp_file. as_file_mut ( ) ) . unwrap ( ) ;
708+
709+ let cmd_output = Command :: new ( "opusinfo" )
710+ . arg ( temp_file. path ( ) . to_str ( ) . unwrap ( ) )
711+ . output ( )
712+ . unwrap ( ) ;
713+
714+ assert ! ( cmd_output. status. success( ) ) ;
715+
716+ let stderr = String :: from_utf8 ( cmd_output. stderr ) . unwrap ( ) ;
717+
718+ assert ! ( !stderr. contains( "WARNING:" ) ) ;
719+ }
720+
692721 #[ test]
693722 fn insert_empty ( ) {
694723 let mut tag = Tag :: new ( TagType :: ID3v2 ) ;
You can’t perform that action at this time.
0 commit comments