diff --git a/base b/base index 1c0cf8963..3ff07f9a0 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 1c0cf8963b19068679b19ef52ebffd0ffafae627 +Subproject commit 3ff07f9a05f3b075798b67a15aa0881733e2751d 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) 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