diff options
author | Albert Astals Cid <aacid@kde.org> | 2008-03-22 15:43:07 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2008-03-22 15:43:07 +0100 |
commit | 066595dd06c930997d5ec65a06c822616af9baa0 (patch) | |
tree | f1c1127d46fa02d4469e769f0df16da174fd9ef7 | |
parent | 23b6475463f8973b5ac83bb21a6b7b6000cc435b (diff) |
Check the document stream is seekable when opening it
Fixes bug 14126
-rw-r--r-- | poppler/PDFDoc.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index c0c8f58c..b27fd7ca 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -181,6 +181,13 @@ PDFDoc::PDFDoc(BaseStream *strA, GooString *ownerPassword, } GBool PDFDoc::setup(GooString *ownerPassword, GooString *userPassword) { + str->setPos(0, -1); + if (str->getPos() <= 0) + { + error(-1, "Document base stream is not seekable"); + return gFalse; + } + str->reset(); // check footer |