summaryrefslogtreecommitdiff
path: root/libview/ev-jobs.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-12-30 20:24:44 +0100
committerraveit65 <[email protected]>2021-01-07 20:37:14 +0100
commit21dfebaac3f2edfb0805b61de950859e36b53289 (patch)
tree1f1ccd0c62f9529c48f225be35e61ec6369b33f5 /libview/ev-jobs.c
parenta3173f89e2cbec52df8e17d158b4a9be4d88c8b3 (diff)
downloadatril-21dfebaac3f2edfb0805b61de950859e36b53289.tar.bz2
atril-21dfebaac3f2edfb0805b61de950859e36b53289.tar.xz
Check whether the document page failed to render
Diffstat (limited to 'libview/ev-jobs.c')
-rw-r--r--libview/ev-jobs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c
index dca41a9a..5db40cab 100644
--- a/libview/ev-jobs.c
+++ b/libview/ev-jobs.c
@@ -612,7 +612,18 @@ ev_job_render_run (EvJob *job)
rc = ev_render_context_new (ev_page, job_render->rotation, job_render->scale);
g_object_unref (ev_page);
- job_render->surface = ev_document_render (job->document, rc);
+ if ((job_render->surface = ev_document_render (job->document, rc)) == NULL) {
+ ev_document_fc_mutex_unlock ();
+ ev_document_doc_mutex_unlock ();
+ g_object_unref (rc);
+ ev_job_failed (job,
+ EV_DOCUMENT_ERROR,
+ EV_DOCUMENT_ERROR_INVALID,
+ _("Failed to render page %d"),
+ job_render->page);
+ return FALSE;
+ }
+
/* If job was cancelled during the page rendering,
* we return now, so that the thread is finished ASAP
*/