From f0c208554c5ccf628965c0b4b1415ac04789876e Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 24 Sep 2024 03:14:49 -0400 Subject: [BugFix] Playback.c OOM with large voice file with our large voice file being loaded in its entirety to the buffer there isn't enough room to allocate the required pcm buffer well prior to this patch we looked for 1k free to allow the talk buffer to be given away well the pcm buffer expects something like 5-600 kb on the clipzip and there is 1k allocatable but not 300 more so instead get the required pcm buffer size and check against that Change-Id: I40a056e4170c37bc3429f0cb37af221ae7f812e5 --- apps/playback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/playback.c') diff --git a/apps/playback.c b/apps/playback.c index 9fe6da6d0e..fb2b6eb1ef 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1040,7 +1040,7 @@ static void audio_reset_buffer(void) core_free(audiobuf_handle); audiobuf_handle = 0; } - if (core_allocatable() < (1 << 10)) + if (core_allocatable() < pcmbuf_size_reqd()) talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ audiobuf_handle = core_alloc_maximum(&filebuflen, &ops); -- cgit v1.2.3