@@ -24,7 +24,7 @@ pub const MAX_COMPONENTS: usize = 4;
2424mod lossless;
2525use self :: lossless:: compute_image_lossless;
2626
27- #[ cfg_attr ( rustfmt, rustfmt_skip ) ]
27+ #[ rustfmt:: skip ]
2828static UNZIGZAG : [ u8 ; 64 ] = [
2929 0 , 1 , 8 , 16 , 9 , 2 , 3 , 10 ,
3030 17 , 24 , 32 , 25 , 18 , 11 , 4 , 5 ,
@@ -595,7 +595,7 @@ impl<R: Read> Decoder<R> {
595595 }
596596
597597 let frame = self . frame . as_ref ( ) . unwrap ( ) ;
598- let preference = Self :: select_worker ( & frame, PreferWorkerKind :: Multithreaded ) ;
598+ let preference = Self :: select_worker ( frame, PreferWorkerKind :: Multithreaded ) ;
599599
600600 worker_scope. get_or_init_worker ( preference, |worker| {
601601 self . decode_planes ( worker, planes, planes_u16)
@@ -616,14 +616,13 @@ impl<R: Read> Decoder<R> {
616616
617617 let frame = self . frame . as_ref ( ) . unwrap ( ) ;
618618
619- if {
620- let required_mem = frame
621- . components
622- . len ( )
623- . checked_mul ( frame. output_size . width . into ( ) )
624- . and_then ( |m| m. checked_mul ( frame. output_size . height . into ( ) ) ) ;
625- required_mem. map_or ( true , |m| self . decoding_buffer_size_limit < m)
626- } {
619+ if frame
620+ . components
621+ . len ( )
622+ . checked_mul ( frame. output_size . width . into ( ) )
623+ . and_then ( |m| m. checked_mul ( frame. output_size . height . into ( ) ) )
624+ . map_or ( true , |m| self . decoding_buffer_size_limit < m)
625+ {
627626 return Err ( Error :: Format (
628627 "size of decoded image exceeds maximum allowed size" . to_owned ( ) ,
629628 ) ) ;
@@ -779,6 +778,7 @@ impl<R: Read> Decoder<R> {
779778 }
780779 }
781780
781+ #[ allow( clippy:: type_complexity) ]
782782 fn decode_scan (
783783 & mut self ,
784784 frame : & FrameInfo ,
@@ -1009,10 +1009,11 @@ impl<R: Read> Decoder<R> {
10091009 // In the event of non-interleaved streams, if we're still building the buffer out,
10101010 // keep going; don't send it yet. We also need to ensure we don't skip over the last
10111011 // row(s) of the image.
1012- if !is_interleaved && ( mcu_y + 1 ) * 8 < frame. image_size . height {
1013- if ( mcu_y + 1 ) % component. vertical_sampling_factor as u16 > 0 {
1014- continue ;
1015- }
1012+ if !is_interleaved
1013+ && ( mcu_y + 1 ) * 8 < frame. image_size . height
1014+ && ( mcu_y + 1 ) % component. vertical_sampling_factor as u16 > 0
1015+ {
1016+ continue ;
10161017 }
10171018
10181019 let coefficients_per_mcu_row = component. block_size . width as usize
@@ -1069,6 +1070,7 @@ impl<R: Read> Decoder<R> {
10691070 }
10701071}
10711072
1073+ #[ allow( clippy:: too_many_arguments) ]
10721074fn decode_block < R : Read > (
10731075 reader : & mut R ,
10741076 coefficients : & mut [ i16 ; 64 ] ,
@@ -1321,6 +1323,7 @@ fn compute_image(
13211323 }
13221324}
13231325
1326+ #[ allow( clippy:: type_complexity) ]
13241327pub ( crate ) fn choose_color_convert_func (
13251328 component_count : usize ,
13261329 color_transform : ColorTransform ,
0 commit comments