From 0810c05d1380fd09f3f29320765f8529c0efe282 Mon Sep 17 00:00:00 2001 From: ailurux Date: Mon, 9 Dec 2024 13:23:27 +1100 Subject: [PATCH] Prevent frame decoding issues with FLAC from ending playback early --- lib/drflac/dr_flac.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/drflac/dr_flac.h b/lib/drflac/dr_flac.h index 14324cf3..b3fd92e0 100644 --- a/lib/drflac/dr_flac.h +++ b/lib/drflac/dr_flac.h @@ -5703,6 +5703,8 @@ static drflac_bool32 drflac__read_and_decode_next_flac_frame(drflac* pFlac) if (result != DRFLAC_SUCCESS) { if (result == DRFLAC_CRC_MISMATCH) { continue; /* CRC mismatch. Skip to the next frame. */ + } else if (result == DRFLAC_ERROR) { + continue; /* Frame parsing error. Skip to the next frame. */ } else { return DRFLAC_FALSE; }