Page 1 of 1

Read access violation

Posted: 2008-05-20T10:26:14-07:00
by assk
TIFF with JPEG compession, compress_tag=6
sample: http://rekler.ru/temp/1.tif

file tiff.c

Code: Select all

       if (((codec == (TIFFCodec *) NULL)) || (codec->scheme != compress_tag))
		{
          compress_tag=COMPRESSION_NONE;  /* compression not supported */
		}
Failed with read access violation in last line:

Code: Select all

        /*
          Convert image to DirectClass pixel packets.
        */
        p=pixels+number_pixels-1;
        for (y=0; y < (long) image->rows; y++)
        {
          q=SetImagePixels(image,0,y,image->columns,1);
          if (q == (PixelPacket *) NULL)
            break;
          q+=image->columns-1;
          for (x=0; x < (long) image->columns; x++)
          {
            q->red=ScaleCharToQuantum((unsigned char) TIFFGetR(*p));
Solution?

Code: Select all

        if (((codec == (TIFFCodec *) NULL)) || (codec->scheme != compress_tag))
		{
          compress_tag=COMPRESSION_NONE;  /* compression not supported */
		  TIFFClose(tiff);
          ThrowReaderException(CoderError,"CompressionNotSupported");
		}