Index: frmts/gtiff/tif_ovrcache.h
===================================================================
--- frmts/gtiff/tif_ovrcache.h	(révision 12487)
+++ frmts/gtiff/tif_ovrcache.h	(copie de travail)
@@ -59,7 +59,7 @@
     unsigned char *pabyRow1Blocks;
     unsigned char *pabyRow2Blocks;
 
-    int		nDirOffset;
+    toff_t	nDirOffset;
     TIFF	*hTIFF;
     int		bTiled;
     
@@ -81,7 +81,7 @@
                                int nBlockXSize, int nBlockYSize,
                                int nSampleFormat, const char * pszResampling );
 
-uint32 TIFF_WriteOverview( TIFF *, int, int, int, int, int, int, int,
+toff_t TIFF_WriteOverview( TIFF *, int, int, int, int, int, int, int,
                            int, int, int, int, unsigned short *,
                            unsigned short *, unsigned short *, int );
 
Index: frmts/gtiff/tif_overview.c
===================================================================
--- frmts/gtiff/tif_overview.c	(révision 12487)
+++ frmts/gtiff/tif_overview.c	(copie de travail)
@@ -79,7 +79,7 @@
 /*      function is called.                                             */
 /************************************************************************/
 
-uint32 TIFF_WriteOverview( TIFF *hTIFF, int nXSize, int nYSize,
+toff_t TIFF_WriteOverview( TIFF *hTIFF, int nXSize, int nYSize,
                            int nBitsPerPixel, int nPlanarConfig, int nSamples, 
                            int nBlockXSize, int nBlockYSize,
                            int bTiled, int nCompressFlag, int nPhotometric,
@@ -90,8 +90,8 @@
                            int bUseSubIFDs )
 
 {
-    uint32	nBaseDirOffset;
-    uint32	nOffset;
+    toff_t	nBaseDirOffset;
+    toff_t	nOffset;
 
     nBaseDirOffset = TIFFCurrentDirOffset( hTIFF );
 
@@ -563,7 +563,7 @@
     for( i = 0; i < nOverviews; i++ )
     {
         int	nOXSize, nOYSize, nOBlockXSize, nOBlockYSize;
-        uint32  nDirOffset;
+        toff_t  nDirOffset;
 
         nOXSize = (nXSize + panOvList[i] - 1) / panOvList[i];
         nOYSize = (nYSize + panOvList[i] - 1) / panOvList[i];
Index: frmts/gtiff/geotiff.cpp
===================================================================
--- frmts/gtiff/geotiff.cpp	(révision 12487)
+++ frmts/gtiff/geotiff.cpp	(copie de travail)
@@ -75,7 +75,7 @@
     
     TIFF	*hTIFF;
 
-    uint32      nDirOffset;
+    toff_t      nDirOffset;
     int		bBase;
 
     uint16	nPlanarConfig;
@@ -113,7 +113,7 @@
     GDALColorTable *poColorTable;
 
     void	WriteGeoTIFFInfo();
-    int		SetDirectory( uint32 nDirOffset = 0 );
+    int		SetDirectory( toff_t nDirOffset = 0 );
     void        SetupTFW(const char *pszBasename);
 
     int		nOverviewCount;
@@ -150,7 +150,7 @@
     virtual CPLErr IBuildOverviews( const char *, int, int *, int, int *, 
                                     GDALProgressFunc, void * );
 
-    CPLErr	   OpenOffset( TIFF *, uint32 nDirOffset, int, GDALAccess );
+    CPLErr	   OpenOffset( TIFF *, toff_t nDirOffset, int, GDALAccess );
 
     static GDALDataset *OpenDir( const char *pszFilename );
     static GDALDataset *Open( GDALOpenInfo * );
@@ -1859,7 +1859,7 @@
 int GTiffDataset::IsBlockAvailable( int nBlockId )
 
 {
-    uint32 *panByteCounts = NULL;
+    toff_t *panByteCounts = NULL;
 
     if( ( TIFFIsTiled( hTIFF ) 
           && TIFFGetField( hTIFF, TIFFTAG_TILEBYTECOUNTS, &panByteCounts ) )
@@ -2052,7 +2052,7 @@
 
         if( panOverviewList[i] > 0 )
         {
-            uint32	nOverviewOffset;
+            toff_t	nOverviewOffset;
             int         nOXSize, nOYSize;
 
             nOXSize = (GetRasterXSize() + panOverviewList[i] - 1) 
@@ -2515,7 +2515,7 @@
 /*                            SetDirectory()                            */
 /************************************************************************/
 
-int GTiffDataset::SetDirectory( uint32 nNewOffset )
+int GTiffDataset::SetDirectory( toff_t nNewOffset )
 
 {
     Crystalize();
@@ -2664,7 +2664,7 @@
 /* -------------------------------------------------------------------- */
     const char *pszFilename = pszCompositeName + 10;
     int        bAbsolute = FALSE;
-    uint32     nOffset;
+    toff_t     nOffset;
     
     if( EQUALN(pszFilename,"off:",4) )
     {
@@ -2744,7 +2744,7 @@
 /*      full res, and overview pages.                                   */
 /************************************************************************/
 
-CPLErr GTiffDataset::OpenOffset( TIFF *hTIFFIn, uint32 nDirOffsetIn, 
+CPLErr GTiffDataset::OpenOffset( TIFF *hTIFFIn, toff_t nDirOffsetIn, 
 				 int bBaseIn, GDALAccess eAccess )
 
 {
@@ -3290,7 +3290,7 @@
         while( !TIFFLastDirectory( hTIFF ) 
                && TIFFReadDirectory( hTIFF ) != 0 )
         {
-            uint32	nThisDir = TIFFCurrentDirOffset(hTIFF);
+            toff_t	nThisDir = TIFFCurrentDirOffset(hTIFF);
             uint32	nSubType;
 
             if( TIFFGetField(hTIFF, TIFFTAG_SUBFILETYPE, &nSubType)

