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
November 2003

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

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



Valid HTML 4.01!



Thread

2003.11.18 10:23 "TIFFGetField COLORMAP memory allocation", by Nathan Becker
2003.11.18 11:28 "TIFFGetField COLORMAP memory allocation", by Ross Finlayson

2003.11.18 10:23 "TIFFGetField COLORMAP memory allocation", by Nathan Becker

Hi,

I'm trying to read the colormap from an RGB palette tiff file using

something like

..._TIFFmalloc(red...);
...green...
...blue...
TIFFGetField(tiff, TIFFTAG_COLORMAP, &red, &green, &blue);
...
_TIFFfree(red);

After a bunch of seg faults and screwing around I realized that 
TIFFGetField seems to secretly allocate the memory for red, green, and 
blue.  Is this right?  The documentation seems to indicate I'm supposed to 
provide allocated memory to TIFFGetField.  Also, if it does secretly 
allocate memory, then am I supposed to free the red, green, blue arrays?  
It seems like not because doing so gives me a seg fault.

thanks in advance for the help,

Nathan