Do not move NULL pointers in buflibmove_callback(). Fixes some skin crashes when changing themes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30610 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fe3eadffba
commit
117ebdb28c
|
@ -93,8 +93,10 @@ static int buflibmove_callback(int handle, void* current, void* new)
|
|||
if (alloc->handle_locked)
|
||||
return BUFLIB_CB_CANNOT_MOVE;
|
||||
|
||||
alloc->font.bits += diff;
|
||||
alloc->font.offset += diff;
|
||||
if (alloc->font.bits)
|
||||
alloc->font.bits += diff;
|
||||
if (alloc->font.offset)
|
||||
alloc->font.offset += diff;
|
||||
if (alloc->font.width)
|
||||
alloc->font.width += diff;
|
||||
|
||||
|
@ -102,8 +104,10 @@ static int buflibmove_callback(int handle, void* current, void* new)
|
|||
alloc->font.buffer_end += diff;
|
||||
alloc->font.buffer_position += diff;
|
||||
|
||||
alloc->font.cache._index += diff;
|
||||
alloc->font.cache._lru._base += diff;
|
||||
if (alloc->font.cache._index)
|
||||
alloc->font.cache._index += diff;
|
||||
if (alloc->font.cache._lru._base)
|
||||
alloc->font.cache._lru._base += diff;
|
||||
|
||||
return BUFLIB_CB_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue