Read access violation

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
assk

Read access violation

Post 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");
		}
Post Reply