summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2014-05-23 11:46:04 +0100
committerRobin Watts <robin.watts@artifex.com>2014-05-23 11:50:10 +0100
commit074cd54f24d7b2121c3873e3b62a2161b2e014e0 (patch)
treea5250f6daf6008717398fc626d1a11e7adc3f39f /source
parent3eba9a357d65f9dfd4854b6645e09015e2e0267c (diff)
downloadmupdf-074cd54f24d7b2121c3873e3b62a2161b2e014e0.tar.xz
Bug 695183: Inflate large buffers at a time for speed.
When I changed the stream implementations to use implementation specific buffers, rather than a generic public one in every fz_stream, I changed fz_read_byte to only get a single byte at a time. I noted at the time that the underlying stream was free to decode larger blocks if it wanted too, but I forgot to actually do this for the flate decoder. Fixing this here should solve the speed issues.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/filter-flate.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/fitz/filter-flate.c b/source/fitz/filter-flate.c
index b306c9c3..4b01d0be 100644
--- a/source/fitz/filter-flate.c
+++ b/source/fitz/filter-flate.c
@@ -22,16 +22,14 @@ static void zfree(void *opaque, void *ptr)
}
static int
-next_flated(fz_stream *stm, int outlen)
+next_flated(fz_stream *stm, int required)
{
fz_flate *state = stm->state;
fz_stream *chain = state->chain;
z_streamp zp = &state->z;
int code;
unsigned char *outbuf = state->buffer;
-
- if (outlen > sizeof(state->buffer))
- outlen = sizeof(state->buffer);
+ int outlen = sizeof(state->buffer);
if (stm->eof)
return EOF;