[Tiff] Re: [gdal-dev] Problem with libTiff on Solaris 10

Even Rouault even.rouault at mines-paris.org
Sat May 31 11:45:53 EDT 2008


And I suspect that the "_TIFFmemcpy(n,&o->tdir_offset,4)" is also bogus as 
tdir_offset is 64 bit large too.
That should be fixed too by the same method :

nTemp = (uint32)o->tdir_offset;
_Tiffmemcpy(n, &nTemp, 4);

Those problems are probably not seen on little endian machines as the first 4 
bytes contain the lowest 32 bit word, which is the one we want to put into 
the n pointer... I'm also wondering why there's not a test to see if it must 
be swabbed afterwards, as it's done for the tag, type and count fields.

Le Saturday 31 May 2008 17:30:11 Even Rouault, vous avez écrit :
> Dan,
>
> Your fix is not the right one. But I recognize that my previous suggestion
> could lead into error.
>
> In fact, tdir_count field is a uint64 in libtiff 4.0.
> So the correct fix is :
>
> uint32 nTemp = (uint32)o->tdir_count;
> _Tiffmemcpy(n, &nTemp, 4);
>
> Even
>
> ---------------------------------------------------------------------------
>--------
>
> RE: [Tiff] Re: [gdal-dev] Problem with libTiff on Solaris 10
> De :
> Dan Greve <grevedan at hotmail.com>
>   À :
> Bob Friesenhahn <bfriesen at simple.dallas.tx.us>, Even Rouault
> <even.rouault at mines-paris.org>
>   CC :
> gdal-dev at lists.osgeo.org, tiff at lists.osgeo.org, Andy Cave
> <andy.cave at hamillroad.com>, mailing list <tiff at lists.maptools.org>
>   Date :
> Aujourd'hui 16:49:15
>    
> Sure enough, the pointer n is not null, and throws a sigsegv fault. Aftern
> changing from
>  
> *(uint32*)n=(uint32)o->tdir_count;            TO
>  
> _TIFFmemcpy(n, &o->tdir_count, 4)
>  
> The execution passes this point, but where as *(uint32*)n should be 1, it
> is 0. This causes errors later in the GDALOpen call on the tiff dataset,
> which fails with error "TiffFetchNormalTag:incorrect count for
> "SamplesPerPixel". debugging continues....
>  
> -- Dan Greve
> -- Software Engineering
> -- Northrop Grumman Corp.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list