2005.05.03 11:35 "[Tiff] TIFFReadRGBAImage problem", by Katrina Maramba

Hello,

Im doing a project wherein I'd have to put all the image data (meaning: starting from first offset to the last) on a data buffer and feed it to the TIFFReadRGBAImage API and have the image parsed. I already made sure that the elements of the tiff structure which is a parameter of this API contains the right values it needs.

Unfortunately, it does not work.

This is where the error occurs (in tif_lzw.c):

free_entp->next = oldcodep;
if (free_entp->next < &sp->dec_codetab[0] ||
   free_entp->next >= &sp->dec_codetab[CSIZE]) {
   TIFFError(tif->tif_name,
   "LZWDecode: Corrupted LZW table at scanline %d",
   tif->tif_row);
            return (0);
}

The address of free_entp->next is 8-digit less of &sp->dec_codetab[0].

My guess is it is because my buffer starts at the 8th byte of the original image (because I already parsed and disregarded the 8-byte header). But Im not very sure.

Can anyone take a guess on what went wrong? What is the easiest fix for this?

Thanks!