Fixed problem with offset value manipulation as per bug

http://bugzilla.remotesensing.org/show_bug.cgi?id=1322
This commit is contained in:
Andrey Kiselev 2006-10-12 17:38:48 +00:00
parent 9876fb1391
commit 1b6451a4f5

View File

@ -1,4 +1,4 @@
/* $Id: tif_win32.c,v 1.18 2006-02-07 11:03:29 dron Exp $ */
/* $Id: tif_win32.c,v 1.19 2006-10-12 17:38:48 dron Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -51,11 +51,10 @@ _tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
static toff_t
_tiffSeekProc(thandle_t fd, toff_t off, int whence)
{
DWORD dwMoveMethod, dwMoveHigh;
ULARGE_INTEGER li;
DWORD dwMoveMethod;
/* we use this as a special code, so avoid accepting it */
if( off == 0xFFFFFFFF )
return 0xFFFFFFFF;
li.QuadPart = off;
switch(whence)
{
@ -72,9 +71,8 @@ _tiffSeekProc(thandle_t fd, toff_t off, int whence)
dwMoveMethod = FILE_BEGIN;
break;
}
dwMoveHigh = 0;
return ((toff_t)SetFilePointer(fd, (LONG) off, (PLONG)&dwMoveHigh,
dwMoveMethod));
return ((toff_t)SetFilePointer(fd, (LONG) li.LowPart,
(PLONG)&li.HighPart, dwMoveMethod));
}
static int