>I've been about worried what happens if read returns None for an tiff/webp image and d.cleanup() is called for the TiffDecoder.

d.cleanup() calls decode.c:_decode_cleanup, which checks the decoder struct to see if there's a cleanup method in the pointer before dispatching to it.