2022.12.12 18:31 "Re: [Tiff] libtiff v4.5.0 release candidate available", by Even Rouault
Well, so fixing that particular issue was not too hard, but I then discovered that TIFFSetDirectory() that used to be fast before was slow now due to IFD looping detection having been added. So I've decided to bite the bullet and add a hashset/hashmap based detection of IFD (luckily I had a C one at hand), which considerably speeds up things, and also bump tdir_t type to uint32_t. So now the limit is raised to 1048576 IFDs (could be larger, but as this is untested area, I preferred to enforce a not too big limit).
Now on your test file, one can loop through all directories beyond the 65535th one with TIFFReadDirectory() and seek to an arbitrary one with TIFFSetDirectory().
Work in https://gitlab.com/libtiff/libtiff/-/merge_requests/436. Please test
My software is free, but my time generally not.