From 2ff12af50cd9713aa39de9ca410778eb2fad88bb Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 23 Oct 2014 09:01:10 +0800 Subject: [PATCH 1/3] protected call of mupdf.renderImage --- frontend/document/credocument.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/document/credocument.lua b/frontend/document/credocument.lua index 5d77ff10f..bae09b6ad 100644 --- a/frontend/document/credocument.lua +++ b/frontend/document/credocument.lua @@ -148,9 +148,11 @@ function CreDocument:getCoverPageImage() local data, size = self._document:getCoverPageImageData() if data and size then local Mupdf = require("ffi/mupdf") - local image = Mupdf.renderImage(data, size) - ffi.C.free(data) - return image + local ok, image = pcall(Mupdf.renderImage, data, size) + if ok then + ffi.C.free(data) + return image + end end end From 281df50da5e782d6410a07056f44975c704e4350 Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 23 Oct 2014 13:48:45 +0800 Subject: [PATCH 2/3] fix #1028 --- frontend/cache.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cache.lua b/frontend/cache.lua index 60f1bc826..a7306a619 100644 --- a/frontend/cache.lua +++ b/frontend/cache.lua @@ -69,8 +69,8 @@ end function Cache:insert(key, object) -- guarantee that we have enough memory in cache if(object.size > self.max_memsize) then - -- we're not allowed to claim this much at all - error("too much memory claimed") + DEBUG("too much memory claimed for", key) + return end -- delete objects that least recently used -- (they are at the end of the cache_order array) From 9eb86441cddbd2bd453aad581f7d0c6f8922012e Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 23 Oct 2014 14:09:21 +0800 Subject: [PATCH 3/3] update base to use new libcrengine --- base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base b/base index 1c0cf8963..3ff07f9a0 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 1c0cf8963b19068679b19ef52ebffd0ffafae627 +Subproject commit 3ff07f9a05f3b075798b67a15aa0881733e2751d