[fix] PicDocument: Pass a copy of image_bb in getCoverPageImage() (#4628)

Avoids a use-after-free in mupdf.scaleBlitBuffer

Fix koreader/koreader-base#821

Thanks for the hint, @poire-z ;).

* As @poire-z suggested, the original unscaled bb should probably be free'd.
This commit is contained in:
NiLuJe
2019-02-21 08:59:41 +01:00
committed by Frans de Jonge
parent 8e5c1addf5
commit 6c29b7da65
2 changed files with 2 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ end
function PicDocument:getCoverPageImage()
local first_page = self._document:openPage(1)
if first_page.image_bb then
return first_page.image_bb
return first_page.image_bb:copy()
end
return nil
end