[evince] shell: Fix crash when comics says it's encrypted
- From: Bastien Nocera <hadess src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [evince] shell: Fix crash when comics says it's encrypted
 
- Date: Sat, 22 Jul 2017 13:04:19 +0000 (UTC)
 
commit 1703978aab3c916100797845608050bb8e40f856
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jul 18 17:39:19 2017 +0200
    shell: Fix crash when comics says it's encrypted
    
    Returning an EV_DOCUMENT_ERROR_ENCRYPTED error to the shell should only
    trigger a password prompt if the document supports the
    EvDocumentSecurity to pass the password to the loader.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784963
 shell/ev-window.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 46cc5c2..6509b51 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1714,7 +1714,8 @@ ev_window_load_job_cb (EvJob *job,
                return;
        }
 
-       if (g_error_matches (job->error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_ENCRYPTED)) {
+       if (g_error_matches (job->error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_ENCRYPTED) &&
+           EV_IS_DOCUMENT_SECURITY (document)) {
                gchar *password;
                
                setup_view_from_metadata (ev_window);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]