summaryrefslogtreecommitdiff
path: root/libview/ev-pixbuf-cache.c
diff options
context:
space:
mode:
authorMatvey Soloviev <[email protected]>2014-08-21 04:33:12 -0400
committerMatvey Soloviev <[email protected]>2014-08-21 04:33:12 -0400
commit3ee926bf4b923b8ec3373cc1eca2f9f3fd028aeb (patch)
tree370b1853eb41666f8dc5ecf0c65581b9c5e1c761 /libview/ev-pixbuf-cache.c
parent1bdae54253b68f2042f1d7f43ac0f36654c9b432 (diff)
downloadatril-3ee926bf4b923b8ec3373cc1eca2f9f3fd028aeb.tar.bz2
atril-3ee926bf4b923b8ec3373cc1eca2f9f3fd028aeb.tar.xz
Fix crash when clicking empty canvas while loading.
Diffstat (limited to 'libview/ev-pixbuf-cache.c')
-rw-r--r--libview/ev-pixbuf-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c
index 367f70d7..9741e434 100644
--- a/libview/ev-pixbuf-cache.c
+++ b/libview/ev-pixbuf-cache.c
@@ -88,7 +88,7 @@ static gboolean new_selection_surface_needed(EvPixbufCache *pixbuf_cac
#define VISIBLE_NEXT_LEN(pixbuf_cache) \
(MIN(pixbuf_cache->preload_cache_size, ev_document_get_n_pages (pixbuf_cache->document) - (1 + pixbuf_cache->end_page)))
#define PAGE_CACHE_LEN(pixbuf_cache) \
- ((pixbuf_cache->end_page - pixbuf_cache->start_page) + 1)
+ (pixbuf_cache->start_page>=0?((pixbuf_cache->end_page - pixbuf_cache->start_page) + 1):0)
#define MAX_PRELOADED_PAGES 3