summaryrefslogtreecommitdiff
path: root/pdf/pdf_lex.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-01-06 14:57:56 +0000
committerRobin Watts <robin.watts@artifex.com>2012-01-06 14:57:56 +0000
commit95f29c10759bc42e940869f1a0d2f82db16f8709 (patch)
tree16c0563ee04f58ee8e6ec75ff09764230ca0ef14 /pdf/pdf_lex.c
parent6dd9108c5865c1ea2ab0e834f4ae85aa279bcca9 (diff)
downloadmupdf-95f29c10759bc42e940869f1a0d2f82db16f8709.tar.xz
PDF fixes/tweaks.
Fix 2 places where we were filling a stroked pattern rather than stroking it. Cope with being asked to run a NULL buffer. If running a stream fails, warn and return what we have, rather than giving up entirely. Should really set a return code for each render. Only look at the Print flag bit for Print renders. Only look at the View flag bit for view renders. If we find an unexpected ) or > during object parsing, warn and continue rather than giving up entirely. If optional content groups are broken, render the rest of the page anyway. Previously indirect objects that point to another indirection would cause a failure; now attempt to resolve these. We set an arbitrary limit of 10 such redirections to avoid infinite loops.
Diffstat (limited to 'pdf/pdf_lex.c')
-rw-r--r--pdf/pdf_lex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pdf/pdf_lex.c b/pdf/pdf_lex.c
index edb27b7b..24828412 100644
--- a/pdf/pdf_lex.c
+++ b/pdf/pdf_lex.c
@@ -403,7 +403,8 @@ pdf_lex(fz_stream *f, char *buf, int n, int *sl)
*sl = lex_string(f, buf, n);
return PDF_TOK_STRING;
case ')':
- fz_throw(f->ctx, "lexical error (unexpected ')')");
+ fz_warn(f->ctx, "lexical error (unexpected ')')");
+ continue;
case '<':
c = fz_read_byte(f);
if (c == '<')
@@ -422,7 +423,8 @@ pdf_lex(fz_stream *f, char *buf, int n, int *sl)
{
return PDF_TOK_CLOSE_DICT;
}
- fz_throw(f->ctx, "lexical error (unexpected '>')");
+ fz_warn(f->ctx, "lexical error (unexpected '>')");
+ continue;
case '[':
return PDF_TOK_OPEN_ARRAY;
case ']':