[gs-commits] mupdf/master - 0_6-252-g7e3aba4 - When seeking relative to the current position in a stream object, take number of bytes read into buffer into consideration.
Tor Andersson
tor at ghostscript.com
Tue Aug 3 12:09:48 UTC 2010
commit 7e3aba4422e96e8663fbcc8a73cf84ce5ac529f0
Author: Sebastian Rasmussen <sebras at hotmail.com>
Date: Mon Aug 2 00:27:06 2010 +0000
When seeking relative to the current position in a stream object, take number of bytes read into buffer into consideration.
Ignore-this: a5bbc5a980a7295d2d32e9b8d4202aa1
darcs-hash:20100802002706-86a4e-5e4e8d158f32d3b757a509f1764864475086ada8.gz
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/fitz/stm_read.c b/fitz/stm_read.c
index fb25121..28a92f2 100644
--- a/fitz/stm_read.c
+++ b/fitz/stm_read.c
@@ -121,7 +121,15 @@ void
fz_seek(fz_stream *stm, int offset, int whence)
{
if (stm->seek)
+ {
+ if (whence == 1)
+ {
+ offset = fz_tell(stm) + offset;
+ whence = 0;
+ }
+
stm->seek(stm, offset, whence);
+ }
else if (whence != 2)
{
if (whence == 0)
--
git/hooks/post-receive
More information about the gs-commits
mailing list