fix crash for large BW tif images
(cherry picked from commit d38fee7599)
			
			
This commit is contained in:
		 Hajo Nils Krabbenhöft
					Hajo Nils Krabbenhöft
				
			
				
					committed by
					
						 Alexander Smorkalov
						Alexander Smorkalov
					
				
			
			
				
	
			
			
			 Alexander Smorkalov
						Alexander Smorkalov
					
				
			
						parent
						
							7d28541bbe
						
					
				
				
					commit
					c5d009d6c4
				
			| @@ -221,6 +221,11 @@ bool  TiffDecoder::readData( Mat& img ) | |||||||
|                 (!is_tiled && tile_height0 == std::numeric_limits<uint32>::max()) ) |                 (!is_tiled && tile_height0 == std::numeric_limits<uint32>::max()) ) | ||||||
|                 tile_height0 = m_height; |                 tile_height0 = m_height; | ||||||
|  |  | ||||||
|  |             if(dst_bpp == 8) { | ||||||
|  |                 // we will use TIFFReadRGBA* functions, so allocate temporary buffer for 32bit RGBA | ||||||
|  |                 bpp = 8; | ||||||
|  |                 ncn = 4; | ||||||
|  |             } | ||||||
|             const size_t buffer_size = bpp * ncn * tile_height0 * tile_width0; |             const size_t buffer_size = bpp * ncn * tile_height0 * tile_width0; | ||||||
|             AutoBuffer<uchar> _buffer( buffer_size ); |             AutoBuffer<uchar> _buffer( buffer_size ); | ||||||
|             uchar* buffer = _buffer; |             uchar* buffer = _buffer; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user