summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-09-24 03:14:49 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-09-24 10:47:34 -0400
commitf0c208554c5ccf628965c0b4b1415ac04789876e (patch)
treee1a18f326ad518bb6fa8394c2132b6e74efbe10d /apps/playback.c
parentc3f51b5fe9f947a25bfee145450fddec04404bd5 (diff)
downloadrockbox-f0c208554c5ccf628965c0b4b1415ac04789876e.tar.gz
rockbox-f0c208554c5ccf628965c0b4b1415ac04789876e.zip
[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
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c2
1 files changed, 1 insertions, 1 deletions
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)
1040 core_free(audiobuf_handle); 1040 core_free(audiobuf_handle);
1041 audiobuf_handle = 0; 1041 audiobuf_handle = 0;
1042 } 1042 }
1043 if (core_allocatable() < (1 << 10)) 1043 if (core_allocatable() < pcmbuf_size_reqd())
1044 talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ 1044 talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */
1045 audiobuf_handle = core_alloc_maximum(&filebuflen, &ops); 1045 audiobuf_handle = core_alloc_maximum(&filebuflen, &ops);
1046 1046