summaryrefslogtreecommitdiff
path: root/backend/epub/epub-document.c
diff options
context:
space:
mode:
authorMonsta <[email protected]>2014-11-27 11:20:07 +0300
committerinfirit <[email protected]>2014-12-08 21:46:03 +0100
commitbf5e5fcff80a294fd4d6e051d777ba7f9ecb76a4 (patch)
tree18aa1a8d00702db133ac25d225fca22fd147c64c /backend/epub/epub-document.c
parent08c66fcd1df1e24b846c7114eec96a8e31c95c93 (diff)
downloadatril-bf5e5fcff80a294fd4d6e051d777ba7f9ecb76a4.tar.bz2
atril-bf5e5fcff80a294fd4d6e051d777ba7f9ecb76a4.tar.xz
epub backend: more anti-NULL protection for epub_document_set_index_pages
Diffstat (limited to 'backend/epub/epub-document.c')
-rw-r--r--backend/epub/epub-document.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/epub/epub-document.c b/backend/epub/epub-document.c
index 0a098e48..8651d029 100644
--- a/backend/epub/epub-document.c
+++ b/backend/epub/epub-document.c
@@ -1579,6 +1579,9 @@ page_set_function(linknode *Link, GList *contentList)
static void
epub_document_set_index_pages(GList *index,GList *contentList)
{
+ g_return_if_fail (index != NULL);
+ g_return_if_fail (contentList != NULL);
+
g_list_foreach(index,(GFunc)page_set_function,contentList);
}
@@ -1706,7 +1709,7 @@ epub_document_load (EvDocument* document,
epub_document->contentList = setup_document_content_list (contentOpfUri,&err,epub_document->documentdir);
- if (epub_document->index != NULL)
+ if (epub_document->index != NULL && epub_document->contentList != NULL)
epub_document_set_index_pages(epub_document->index, epub_document->contentList);
epub_document_add_mathJax(contentOpfUri,epub_document->documentdir);