From 2334e08d72263c19cd8da71d104fd6c2aeb75025 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin Date: Sun, 1 Jun 2025 12:07:45 +0300 Subject: [PATCH] Codecs: Fix stuck buffer when advance_buffer fails Fixes FS#9186 (constant noise at the end of truncated flac file) Change-Id: I516282e48cecb2be009b5779115395a50edb6fdc --- apps/codec_thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/codec_thread.c b/apps/codec_thread.c index fdfb6acf43..137ceffdc0 100644 --- a/apps/codec_thread.c +++ b/apps/codec_thread.c @@ -269,6 +269,7 @@ static bool codec_advance_buffer_counters(size_t amount) { if (bufadvance(ci.audio_hid, amount) < 0) { + bufseek(ci.audio_hid, ci.filesize); ci.curpos = ci.filesize; return false; }