Skip to main content

bcn_length

Function bcn_length 

Source
pub fn bcn_length(len: usize) -> u64
Expand description

The length Pillow 9.5.0’s BCn decoder sees for len bytes of data: ImagingBcnDecode passes its Py_ssize_t length to decode_bcn’s int parameter, a conversion GCC and Clang both make modulo 2^32, then as a signed value (C leaves an out-of-range conversion to the implementation), so the decode loop (while (bytes >= SZ)) runs on the length’s low 32 bits, none when bit 31 is set. Below 2 GiB it is the length itself.