| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2008.06.20 18:19 "Re: Scalability problem in tif_dirread.c - detecting loops in IFD offsets", by Edward LamI don't know how important this performance problem is but I think that Steve's suggestion to use Floyd's cycle detection is an easy way to avoid the problem. It would be a good candidate fix for 3.9 if it's important enough. -Edward Andrey Kiselev wrote: > On Fri, Jun 20, 2008 at 08:02:32AM -0400, Steve Eddins wrote: >> Thanks very much for your helpful responses. Interesting that such >> files really exist. > > You can easily create such a file yourself using you favorite binary > editor. With that file you can make a DOS attack on any TIFF software > that is not aware of IFD looping problem. These days we should always > double check the input data and we can trust no one. > > Turning to code I should say that I always wanted to rewrite it and make > a single scan over the file when opening and use resulting table later. > Current TIFFSetDirectory() and TIFFNumberOfDirectories() implementations > are not efficient for heavily multi-paged TIFFs, the IFD offset table can > be used here. But be aware of in-place TIFF modifications, that table > should be properly updated too. > > If you will decide to contribute a patch for this stuff, please, do it > against the 4.0 branch. That is too much for 3.9 which is considered to > be a stable branch. > > Best regards, > Andrey > > |
|||||||