From 2fbf34d7f475c3df36124733a9a94597326e21ed Mon Sep 17 00:00:00 2001 From: JackMacWindows Date: Sun, 18 Oct 2026 21:37:51 -0400 Subject: [PATCH] Mark LRU buffer invalid if reading fails --- ff_ioman.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ff_ioman.c b/ff_ioman.c index 338ab91..4ba831c 100644 --- a/ff_ioman.c +++ b/ff_ioman.c @@ -494,6 +494,9 @@ FF_Buffer_t * FF_GetBuffer( FF_IOManager_t * pxIOManager, if( lRetVal < 0 ) { + /* The contents of the buffer could be partially overwritten, mark the buffer as invalid. */ + pxRLUBuffer->bValid = pdFALSE; + pxRLUBuffer->ulSector = 0; /* 'pxMatchingBuffer' is NULL. */ break; }