mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-01-22 09:40:35 -05:00
font: logf: fix pointer in buflibmove_callback
Buffer contents are only moved after the callback returns, so we need to log the path before it has been updated to prevent reading garbage. Change-Id: I187fbd56484249c456155ffcbdde9e44e766dde8
This commit is contained in:
parent
752467dee4
commit
3da69af83c
1 changed files with 1 additions and 1 deletions
|
|
@ -121,6 +121,7 @@ static int buflibmove_callback(int handle, void* current, void* new)
|
|||
struct buflib_alloc_data *alloc = (struct buflib_alloc_data*)current;
|
||||
ptrdiff_t diff = new - current;
|
||||
|
||||
logf("%s %s", __func__, alloc->path);
|
||||
#define UPDATE(x) if (x) { x = PTR_ADD(x, diff); }
|
||||
|
||||
UPDATE(alloc->font.bits);
|
||||
|
|
@ -134,7 +135,6 @@ static int buflibmove_callback(int handle, void* current, void* new)
|
|||
|
||||
UPDATE(alloc->font.cache._index);
|
||||
UPDATE(alloc->font.cache._lru._base);
|
||||
logf("%s %s", __func__, alloc->path);
|
||||
return BUFLIB_CB_OK;
|
||||
}
|
||||
static void lock_font_handle(int handle, bool lock)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue