Received: by whizzer.wpd.sgi.com (/911001.SGI)
	 id AA28797; Mon, 31 Jan 94 12:44:47 GMT
Received: from sgi.sgi.com by whizzer.wpd.sgi.com via SMTP (/911001.SGI)
	for /usr/people/sam/majordomo/wrapper resend -l tiff -h sgi.sgi.com -f tiff-owner -s -m "-oi -odq -om" tiff-list id AA28789; Mon, 31 Jan 94 04:44:44 -0800
Received: from walthm.cric.com by sgi.sgi.com via SMTP (931110.SGI/910110.SGI)
	for tiff-relay@whizzer.wpd.sgi.com id AA02389; Mon, 31 Jan 94 04:44:41 -0800
Received: from cr.cric.com by WALTHM.CRIC.COM with SMTP;
          Mon, 31 Jan 1994 7:50:19 -0500 (EST)
Received: from rocky.cric.com.cric by cr.cric.com (4.1/SMI-4.1)
	id AA10420; Mon, 31 Jan 94 07:42:26 EST
Date: Mon, 31 Jan 94 07:42:26 EST
From: craig@cr.cric.com (Craig Tulig)
Message-Id: <9401311242.AA10420@cr.cric.com>
To: tiff@sgi.sgi.com
Subject: TIFF/VMS problem
Sender: tiff-owner@sgi.sgi.com


I am experiencing a problem with the TIFF 3.0 library on a VMS platform, and
was wondering of you could offer any suggestions or direct me to 
someone who could help with a VMS/TIFF problem. 

The program below crashes under TIFFClose, when run on a 
VMS v5.5 platform.  (However, it works fine in UNIX).
The cause of the problem seems to be DEC's lseek overwriting memory, 
resulting in the TIFF structure pointed to by the variable 'out' (below)
being completely overwritten with zeroes.  This subsequently
leads to a crash when TIFFWriteData tries to call tif->tif_seekproc, 
because tif_seekproc has been overwritten with NULL.

thank you,
Craig Tulig 

///////////////////////////////////////////////////////////////////////////////
// craig@cric.com             Collaborative Research Inc.                    //
// (617)487-7979 x137             1365 Main Street                           //
// (617)891-5062 (fax)           Waltham, MA. 02154                          //
///////////////////////////////////////////////////////////////////////////////

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

#include <stdlib.h>
#include "tiffio.h"

main()
{
    unsigned char source[100];
    TIFF *out;
    int i;

    out  = TIFFOpen("test.gel", "w");
    if (!out) { printf("Open error.\n"); exit(1); }

    TIFFSetField(out, TIFFTAG_IMAGEWIDTH,      100);
    TIFFSetField(out, TIFFTAG_BITSPERSAMPLE,   (short) 8);
    TIFFSetField(out, TIFFTAG_COMPRESSION,     COMPRESSION_NONE);
    TIFFSetField(out, TIFFTAG_PHOTOMETRIC,     PHOTOMETRIC_MINISWHITE);
    TIFFSetField(out, TIFFTAG_RESOLUTIONUNIT,  (short) 1);
    TIFFSetField(out, TIFFTAG_XRESOLUTION,     (float) 10.0);
    TIFFSetField(out, TIFFTAG_YRESOLUTION,     (float) 20.0);
    TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, (short) 1);
    TIFFSetField(out, TIFFTAG_PLANARCONFIG,    (short) 1);

    for (i = 0; i < 100; i++)
    {
        if (TIFFWriteScanline(out, source, i, 0) < 0)
            { printf("write error\n"); exit(1); }

    }
    TIFFClose(out);
}

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


