GNOME Bugzilla – Bug 737197
Crashes on right click with cbz document
Last modified: 2014-09-26 12:49:53 UTC
Doing right click on a page of a cbz document produces a segmentation fault. Steps to reproduce: 1) Open a cbz file. 2) Right click on any page. Details: evince-3.13.92-1.fc21.x86_64 File (but it occurs with any other cbz file): https://www.dropbox.com/s/qrsfojsgi6w6ysn/oyasumi_punpun_v01_c001.cbz?dl=0 Traces: (evince:21443): GLib-GObject-WARNING **: invalid cast from 'ComicsDocument' to 'EvDocumentAnnotations' Program received signal SIGSEGV, Segmentation fault. ev_document_annotations_can_remove_annotation (document_annots=0x7fffdc0b5b20) at ev-document-annotations.c:92 92 return iface->remove_annotation != NULL; (gdb) thread apply all bt full
+ Trace 234119
Thread 1 (Thread 0x7ffff7fba980 (LWP 21443))
Created attachment 287109 [details] [review] shell: Check if doc implements Annotations interface before cast Without this check, evince will crash when a right-click on a non-pdf document is performed.
Review of attachment 287109 [details] [review]: Thanks! ::: shell/ev-window.c @@ +5056,3 @@ + can_remove_annots = ev_document_annotations_can_remove_annotation (EV_DOCUMENT_ANNOTATIONS (ev_window->priv->document)); + else + can_remove_annots = FALSE; Good catch! Please, initialize the variable to FALSE when declared and remove the else branch.
pushed to master. Thanks for reporting