From 1b6451a4f57f9b2cfcc8536c738b5c5d9a8c4c94 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Thu, 12 Oct 2006 17:38:48 +0000 Subject: [PATCH] Fixed problem with offset value manipulation as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1322 --- libtiff/tif_win32.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c index 6d09ce5a..2e881698 100644 --- a/libtiff/tif_win32.c +++ b/libtiff/tif_win32.c @@ -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