diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2009-05-02 02:45:17 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2009-05-02 02:45:17 +0200 |
commit | d9abee07b7aeb17892350b76ab61ec4f6df33d4a (patch) | |
tree | edce11028938e0f23bc65d17390343f10c87cc9c | |
parent | 472a4314505dec135c9760f1f4ef8d76179ab58d (diff) | |
download | mupdf-d9abee07b7aeb17892350b76ab61ec4f6df33d4a.tar.xz |
Handle corrupt stream dictionary.
-rw-r--r-- | mupdf/pdf_stream.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mupdf/pdf_stream.c b/mupdf/pdf_stream.c index 523145da..77ff809a 100644 --- a/mupdf/pdf_stream.c +++ b/mupdf/pdf_stream.c @@ -192,9 +192,14 @@ buildrawfilter(fz_filter **filterp, pdf_xref *xref, fz_obj *stmobj, int oid, int int len; stmlen = fz_dictgets(stmobj, "Length"); - error = pdf_resolve(&stmlen, xref); - if (error) - return fz_rethrow(error, "cannot resolve stream /Length"); + if (stmlen) + { + error = pdf_resolve(&stmlen, xref); + if (error) + return fz_rethrow(error, "cannot resolve stream /Length"); + } + if (!fz_isint(stmlen)) + return fz_throw("corrupt stream length"); len = fz_toint(stmlen); fz_dropobj(stmlen); |