diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2010-08-02 00:27:06 +0000 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2010-08-02 00:27:06 +0000 |
commit | 8a83148bf7c701049a5692ef48c61b6022d4c6b0 (patch) | |
tree | 3b895c3fb9f01191ef1c1ce37ea174cfdb57a4fd /fitz/stm_read.c | |
parent | caf014b964409d96d2a92e84730825de72bbec34 (diff) | |
download | mupdf-8a83148bf7c701049a5692ef48c61b6022d4c6b0.tar.xz |
When seeking relative to the current position in a stream object, take number of bytes read into buffer into consideration.
Diffstat (limited to 'fitz/stm_read.c')
-rw-r--r-- | fitz/stm_read.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fitz/stm_read.c b/fitz/stm_read.c index fb251214..28a92f22 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) |