mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Fixed bc5 decoding
BC5 decoding uses only 2 channels instead of 4. The current algorithm did not initialize the RGBA struct which resulted in random values in the output image. This commit should initialize the decoded RGBA struct, thus setting B and A values to default (0).
This commit is contained in:
		
							parent
							
								
									2512400d6d
								
							
						
					
					
						commit
						0477278c68
					
				| 
						 | 
					@ -815,6 +815,7 @@ static int decode_bcn(Imaging im, ImagingCodecState state, const UINT8* src, int
 | 
				
			||||||
	case NN: \
 | 
						case NN: \
 | 
				
			||||||
		while (bytes >= SZ) { \
 | 
							while (bytes >= SZ) { \
 | 
				
			||||||
			TY col[16]; \
 | 
								TY col[16]; \
 | 
				
			||||||
 | 
								memset(col, 0, 16 * sizeof(col[0])); \
 | 
				
			||||||
			decode_bc##NN##_block(col, ptr); \
 | 
								decode_bc##NN##_block(col, ptr); \
 | 
				
			||||||
			put_block(im, state, (const char *)col, sizeof(col[0]), C); \
 | 
								put_block(im, state, (const char *)col, sizeof(col[0]), C); \
 | 
				
			||||||
			ptr += SZ; \
 | 
								ptr += SZ; \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user