diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-10-09 12:30:37 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-10-09 12:30:37 +0000 |
commit | 889690c0f60a2ce2cdfd985895d0484c78083df1 (patch) | |
tree | 2b40d92a48d777319584ba5f161ce844970d6f3d /firmware/buflib.c | |
parent | aed39dbbafc2f1cacfdce4382f22b06ab0224aae (diff) | |
download | rockbox-889690c0f60a2ce2cdfd985895d0484c78083df1.tar.gz rockbox-889690c0f60a2ce2cdfd985895d0484c78083df1.zip |
Fix audio_get_buffer() implementation on hwcodec, to be similar to the swcodec one. Should make hwcodec bood again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30737 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/buflib.c')
-rw-r--r-- | firmware/buflib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/buflib.c b/firmware/buflib.c index d82acd77d3..4ffd6cfce3 100644 --- a/firmware/buflib.c +++ b/firmware/buflib.c @@ -628,7 +628,11 @@ buflib_alloc_maximum(struct buflib_context* ctx, const char* name, size_t *size, { /* limit name to 16 since that's what buflib_available() accounts for it */ char buf[16]; + *size = buflib_available(ctx); + if (*size <= 0) /* OOM */ + return -1; + strlcpy(buf, name, sizeof(buf)); return buflib_alloc_ex(ctx, *size, buf, ops); |