2009.07.02 18:15 "[Tiff] Access violation in TiffOpen Function in "write" mode", by acanicio

2009.07.04 17:51 "Re: [Tiff] Access violation in TiffOpen Function in "write" mode", by Bob Friesenhahn

I just found out that I have the same problem with another program, and also

in "r" mode...

I just spent the last 6 hours trying to figure out the problem...

And something incredible happened.

Now it works. :jumping: Without having changed a single line of code!!.

I just set the "record field alignment" in the delphi compiler options to

"4" instead of "2".

Geee... Can anybody explain to me why a value of "2" or "1" this ends up

crashing when using libtiff? :confused:

On some CPU types (probably not yours though) unaligned word access will cause a segmentation violation. In some cases this is a compiler option since the application could arrange use less efficient byte-level access to access the data word, or the OS could trap to a function which does so.

It is likely that the old libtiff you are using has bugs in that it is making assumptions about alignment, endian order, or word size. Oodles of such bugs have been fixed over time. During my short time of helping out with libtiff, I have observed more bugs in the directory tag code than any other part of libtiff.

Regardless, you are likely to see better application performance when you compiler uses a default alignment of 4 rather than something less.

Defaulting to a word alignment of 2 and use of tiny data types for enumerations are Borland oddities which don't match up with MSVC does.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/