summaryrefslogtreecommitdiff
path: root/fitz/stm_read.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2011-02-04 10:29:02 +0000
committerTor Andersson <tor@ghostscript.com>2011-02-04 10:29:02 +0000
commit6e99a4c2803a4d5b0cdaaf1e27b425dfa3d1fd1d (patch)
tree82c337dbde5ddd0edb72a6a31882e643b25b972c /fitz/stm_read.c
parent17921bc919273990bbf68e3ec8e8c8ef24246930 (diff)
downloadmupdf-6e99a4c2803a4d5b0cdaaf1e27b425dfa3d1fd1d.tar.xz
Don't reset stream wp pointer at end of file, since that will clobber streams opened with openbuffer.
Diffstat (limited to 'fitz/stm_read.c')
-rw-r--r--fitz/stm_read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fitz/stm_read.c b/fitz/stm_read.c
index fe34eaa8..4e42ed85 100644
--- a/fitz/stm_read.c
+++ b/fitz/stm_read.c
@@ -47,7 +47,7 @@ fz_fillbuffer(fz_stream *stm)
n = fz_read(stm, stm->bp, stm->ep - stm->bp);
if (n < 0)
fz_catch(n, "read error; treating as end of file");
- else
+ else if (n > 0)
{
stm->rp = stm->bp;
stm->wp = stm->bp + n;