mirror of
https://github.com/koreader/koreader.git
synced 2025-12-18 12:02:09 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user