diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2011-02-09 09:30:09 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2011-02-09 09:30:09 +0000 |
| commit | 0d902c8c54bbc36f24b40c49eb9872aa75b779e4 (patch) | |
| tree | f5c2ae63204ab4032b6be29dea6d5bfe02809a5d /apps/buffering.c | |
| parent | 19ea72ff63744c51292cd1d2d1c2792b009892aa (diff) | |
| download | rockbox-0d902c8c54bbc36f24b40c49eb9872aa75b779e4.zip rockbox-0d902c8c54bbc36f24b40c49eb9872aa75b779e4.tar.gz rockbox-0d902c8c54bbc36f24b40c49eb9872aa75b779e4.tar.bz2 rockbox-0d902c8c54bbc36f24b40c49eb9872aa75b779e4.tar.xz | |
Buffering should align itself and not rely on buffering_reset parameters when storage alignment matters so that wrapped reads maintain alignment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29258 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.c')
| -rw-r--r-- | apps/buffering.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index e37b053..123c7bc 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -1572,6 +1572,11 @@ void buffering_init(void) /* Initialise the buffering subsystem */ bool buffering_reset(char *buf, size_t buflen) { + /* Wraps of storage-aligned data must also be storage aligned, + thus buf and buflen must be a aligned to an integer multiple of + the storage alignment */ + STORAGE_ALIGN_BUFFER(buf, buflen); + if (!buf || !buflen) return false; |