Commit 48e0477a authored by Albert Astals Cid's avatar Albert Astals Cid

numPages returns int, account for < 0 numPages

If numPages < 0 it's an error
parent 770374b0
......@@ -565,7 +565,12 @@ bool PDFGenerator::init(QVector<Okular::Page*> & pagesVector, const QString &wal
}
// build Pages (currentPage was set -1 by deletePages)
uint pageCount = pdfdoc->numPages();
int pageCount = pdfdoc->numPages();
if (pageCount < 0) {
delete pdfdoc;
pdfdoc = 0;
return false;
}
pagesVector.resize(pageCount);
rectsGenerated.fill(false, pageCount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment