poppler/PDFDoc.cc | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 0f24db9612fafdc321e49f6ddfc6553284149724
Author: Adam Sampson <[email protected]>
Date: Sun Dec 27 17:42:21 2020 +0000
PDFDoc::setup: Always set errCode on failure
When something goes wrong, this function should return false and set
errCode to indicate what went wrong. The two new checks added at the top
didn't set errCode.
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index e68b47d0..02116a08 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -253,12 +253,14 @@ bool PDFDoc::setup(const GooString *ownerPassword, const
GooString *userPassword
if (str->getLength() <= 0) {
error(errSyntaxError, -1, "Document stream is empty");
+ errCode = errDamaged;
return false;
}
str->setPos(0, -1);
if (str->getPos() < 0) {
error(errSyntaxError, -1, "Document base stream is not seekable");
+ errCode = errFileIO;
return false;
}
_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler