summaryrefslogtreecommitdiff
path: root/fitz/filt_dctd.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-07-05 17:55:18 +0100
committerRobin Watts <robin.watts@artifex.com>2012-07-05 18:02:03 +0100
commiteeaccf8444a4884801a92c0d23f66bd54c986a67 (patch)
treefc9e254dfeef4d61a80aace2f5dbbcd985580a9a /fitz/filt_dctd.c
parentb81be8d34b179d48e677463bd7b66ffdea129517 (diff)
parent15fc25b0055dbdbfaf4257ac908d43fd5a2da19d (diff)
downloadmupdf-eeaccf8444a4884801a92c0d23f66bd54c986a67.tar.xz
Merge branch 'master' into forms
Diffstat (limited to 'fitz/filt_dctd.c')
-rw-r--r--fitz/filt_dctd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fitz/filt_dctd.c b/fitz/filt_dctd.c
index 23744f01..1b588d2a 100644
--- a/fitz/filt_dctd.c
+++ b/fitz/filt_dctd.c
@@ -101,12 +101,17 @@ read_dctd(fz_stream *stm, unsigned char *buf, int len)
if (!state->init)
{
+ int c;
cinfo->client_data = state;
cinfo->err = &state->errmgr;
jpeg_std_error(cinfo->err);
cinfo->err->error_exit = error_exit;
jpeg_create_decompress(cinfo);
+ /* Skip over any stray returns at the start of the stream */
+ while ((c = fz_peek_byte(state->chain)) == '\n' || c == '\r')
+ (void)fz_read_byte(state->chain);
+
cinfo->src = &state->srcmgr;
cinfo->src->init_source = init_source;
cinfo->src->fill_input_buffer = fill_input_buffer;