AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 1994

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date


The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems

Valid HTML 4.01!

1994.01.31 12:42 "TIFF/VMS problem", by Craig Tulig

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 

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


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

    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_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); }