AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2010.08.22 13:26 "[Tiff] memory error", by Rajat Varma
2010.08.23 13:42 "Re: [Tiff] memory error", by Edward Lam
2010.08.23 15:02 "Re: [Tiff] memory error", by Rajat Varma
2010.08.23 15:15 "Re: [Tiff] memory error", by Scott Ribe
2010.08.23 15:17 "Re: [Tiff] memory error", by Bob Friesenhahn
2010.08.23 15:27 "Re: [Tiff] memory error", by Rajat Varma

2010.08.23 15:27 "Re: [Tiff] memory error", by Rajat Varma

Thank you Bob and Scott for your response.

I have now used uint32 for stripbytecounts and have passed argv and I am still stuck with the following error

LAT-median-filtered.tif: Cannot read TIFF header.

Segmentation fault

and in Valgrind I get

-------------------------------------------------------------------------------------------------------------------- LAT-median-filtered.tif: Cannot read TIFF header.

==5878== Invalid read of size 4

==5878==    at 0x404CCEB: TIFFFindFieldInfo (tif_dirinfo.c:753)
==5878==    by 0x404A843: TIFFVGetField (tif_dir.c:971)
==5878==    by 0x404B33A: TIFFGetField (tif_dir.c:957)
==5878==    by 0x80485B4: main (in

/home/rajat/Desktop/spots_program/testwrite)
==5878== Address 0x284 is not stack'd, malloc'd or (recently) free'd
==5878==
==5878==
==5878== ---- Attach to debugger? --- [Return/N/n/Y/y/C/c] ---- n
==5878==
==5878== Process terminating with default action of signal 11 (SIGSEGV)
==5878== Access not within mapped region at address 0x284

==5878==    at 0x404CCEB: TIFFFindFieldInfo (tif_dirinfo.c:753)
==5878==    by 0x404A843: TIFFVGetField (tif_dir.c:971)
==5878==    by 0x404B33A: TIFFGetField (tif_dir.c:957)
==5878==    by 0x80485B4: main (in

/home/rajat/Desktop/spots_program/testwrite)
==5878== If you believe this happened as a result of a stack
==5878== overflow in your program's main thread (unlikely but
==5878== possible), you can try to increase the size of the
==5878== main thread stack using the --main-stacksize= flag.
==5878== The main thread stack size used in this run was 8388608.

---------------------------------------------------------------------------------------------------------------------------------

thanks

rajat

On Mon, Aug 23, 2010 at 11:17 AM, Bob Friesenhahn < bfriesen@simple.dallas.tx.us> wrote:

On Mon, 23 Aug 2010, Rajat Varma wrote:

>> {

>>                 TIFF *in;
>>                 toff_t* bc;
>>                 uint32 rowspstrip,numrows,numcols;
>>                 uint16 bits;
>>
>>                 in = TIFFOpen(argv[1],"r");
>>
>>                 TIFFGetField(in, TIFFTAG_STRIPBYTECOUNTS, &bc);

The above line looks suspicious to me. The manual page says that this should be type uint32** but you are passing toff_t**.