Use signed variable to check available buffer size.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29848 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
526346b6a7
commit
12e8e43236
1 changed files with 5 additions and 3 deletions
|
@ -177,12 +177,14 @@ void codec_get_full_path(char *path, const char *codec_root_fn)
|
||||||
void *codec_get_buffer_callback(size_t *size)
|
void *codec_get_buffer_callback(size_t *size)
|
||||||
{
|
{
|
||||||
void *buf = &codecbuf[codec_size];
|
void *buf = &codecbuf[codec_size];
|
||||||
*size = CODEC_SIZE - codec_size;
|
ssize_t s = CODEC_SIZE - codec_size;
|
||||||
ALIGN_BUFFER(buf, *size, CACHEALIGN_SIZE);
|
|
||||||
|
|
||||||
if (*size <= 0)
|
if (s <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
*size = s;
|
||||||
|
ALIGN_BUFFER(buf, *size, CACHEALIGN_SIZE);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue