diff --git a/apps/mpeg.c b/apps/mpeg.c
index 2a2821b..6d38132 100644
--- a/apps/mpeg.c
+++ b/apps/mpeg.c
@@ -558,8 +558,10 @@ unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size)
{
(void)talk_buf; /* always grab the voice buffer for now */

- if (buffer_size) /* special case for talk_init() */
- audio_hard_stop();
+ audio_hard_stop();
+
+ if (!buffer_size) /* special case for talk_init() */
+ return NULL;

if (!audiobuf_handle)
{
@@ -572,9 +574,6 @@ unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size)
}
mpeg_audiobuf = core_get_data(audiobuf_handle);

- if (!buffer_size) /* special case for talk_init() */
- talkbuf_init(mpeg_audiobuf);
-
return mpeg_audiobuf;
}

diff --git a/firmware/buflib.c b/firmware/buflib.c
index 3b4f522..dfaa47f 100644
--- a/firmware/buflib.c
+++ b/firmware/buflib.c
@@ -618,7 +618,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);