From cd3a1af793824e33d26efa4fe709316d5617373d Mon Sep 17 00:00:00 2001 From: Matvey Soloviev Date: Thu, 21 Aug 2014 04:33:12 -0400 Subject: Fix crash when clicking empty canvas while loading. --- libview/ev-pixbuf-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1