summaryrefslogtreecommitdiff
path: root/apps/codecs.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs.c')
-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;
}