summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-09 20:43:35 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-09 20:43:35 +0000
commit12e8e432368a300517a789bd6045502964ad95cf (patch)
tree854b4ca198d54b2c875398781d3e62dfacf931ba /apps
parent526346b6a7d63e0b765c4e1177f12ce768932db7 (diff)
downloadrockbox-12e8e432368a300517a789bd6045502964ad95cf.zip
rockbox-12e8e432368a300517a789bd6045502964ad95cf.tar.gz
rockbox-12e8e432368a300517a789bd6045502964ad95cf.tar.bz2
rockbox-12e8e432368a300517a789bd6045502964ad95cf.tar.xz
Use signed variable to check available buffer size.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29848 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index ec566db..249cd8f 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -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;
}