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:
Andree Buschmann 2011-05-09 20:43:35 +00:00
parent 526346b6a7
commit 12e8e43236

View file

@ -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 *buf = &codecbuf[codec_size];
*size = CODEC_SIZE - codec_size;
ALIGN_BUFFER(buf, *size, CACHEALIGN_SIZE);
ssize_t s = CODEC_SIZE - codec_size;
if (*size <= 0)
if (s <= 0)
return NULL;
*size = s;
ALIGN_BUFFER(buf, *size, CACHEALIGN_SIZE);
return buf;
}