summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-09-25 13:34:47 +0200
committerStefano Karapetsas <[email protected]>2014-09-25 13:34:47 +0200
commitd1cb160b8625c774e6f1e2d1cbbcab7811b75c3a (patch)
treebf1a30677dd8ef1d6106c5ee8e1fe3c9f9f9e229 /libview
parentfe2b5a8d20ed88827051f70bd8a15c753f84ec3f (diff)
parent3ee926bf4b923b8ec3373cc1eca2f9f3fd028aeb (diff)
downloadatril-d1cb160b8625c774e6f1e2d1cbbcab7811b75c3a.tar.bz2
atril-d1cb160b8625c774e6f1e2d1cbbcab7811b75c3a.tar.xz
Merge pull request #85 from blackhole89/master
Fix crash when clicking empty canvas while loading.
Diffstat (limited to 'libview')
-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