summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pdf/qpdfdocument.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index 3ef947f..709c702 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -251,9 +251,15 @@ void QPdfDocumentPrivate::checkComplete()
QPdfMutexLocker lock;
- for (int i = 0, count = FPDF_GetPageCount(doc); i < count; ++i)
- if (!FPDFAvail_IsPageAvail(avail, i, this))
+ for (int i = 0, count = FPDF_GetPageCount(doc); i < count; ++i) {
+ int result = PDF_DATA_NOTAVAIL;
+ while (result == PDF_DATA_NOTAVAIL) {
+ result = FPDFAvail_IsPageAvail(avail, i, this);
+ }
+
+ if (result == PDF_DATA_ERROR)
loadComplete = false;
+ }
lock.unlock();