diff options
author | infirit <[email protected]> | 2014-12-09 12:23:34 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-09 23:02:27 +0100 |
commit | db7225b9a188e2df6d7e0729897ca8952a8b9fb3 (patch) | |
tree | cbad0cd0e649a051e878e24fc4aa059161d48b0a /libdocument/ev-document.c | |
parent | 40a47584d8c96b6fe31d1948048ee411cd8b9431 (diff) | |
download | atril-db7225b9a188e2df6d7e0729897ca8952a8b9fb3.tar.bz2 atril-db7225b9a188e2df6d7e0729897ca8952a8b9fb3.tar.xz |
[libdocument] Check for NULL in synctex_backward_search.
Taken from evince commit: 26c3b7e6b2fb3ee2d01ec249f7026a37bcfc2f9c
From: José Aliste <[email protected]>
Gnome bug: 630845
Diffstat (limited to 'libdocument/ev-document.c')
-rw-r--r-- | libdocument/ev-document.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c index fc45830d..b2c5ab41 100644 --- a/libdocument/ev-document.c +++ b/libdocument/ev-document.c @@ -435,11 +435,16 @@ ev_document_synctex_backward_search (EvDocument *document, /* We assume that a backward search returns either zero or one result_node */ node = synctex_next_result (scanner); if (node != NULL) { - result = g_new (EvSourceLink, 1); - result->filename = synctex_scanner_get_name (scanner, - synctex_node_tag (node)); - result->line = synctex_node_line (node); - result->col = synctex_node_column (node); + const gchar *filename; + + filename = synctex_scanner_get_name (scanner, synctex_node_tag (node)); + + if (filename) { + result = g_new (EvSourceLink, 1); + result->filename = filename; + result->line = synctex_node_line (node); + result->col = synctex_node_column (node); + } } } @@ -905,4 +910,4 @@ ev_document_check_add_night_sheet(EvDocument *document) { EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS(document); return klass->check_add_night_sheet(document) ; -}
\ No newline at end of file +} |