mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
buflib: fix buflib_context_relocate alignment check
Use the standard IS_ALIGNED macro and check alignment against sizeof(buflib_data), as it can be greater than 4 bytes if we're on a 64-bit platform (eg. simulator). Change-Id: I15110937d1f2978e733d169050de9531fe218214
This commit is contained in:
parent
bcaa9465e9
commit
f622bcfe4f
1 changed files with 1 additions and 1 deletions
|
|
@ -144,7 +144,7 @@ bool buflib_context_relocate(struct buflib_context *ctx, void *buf)
|
|||
|
||||
/* cannot continue if the buffer is not aligned, since we would need
|
||||
* to reduce the size of the buffer for aligning */
|
||||
if ((uintptr_t)buf & 0x3)
|
||||
if (!IS_ALIGNED((uintptr_t)buf, sizeof(union buflib_data)))
|
||||
return false;
|
||||
|
||||
/* relocate the handle table entries */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue