From a29ff93f9ca25fc517794dbdac61b19a00858c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Launay?= Date: Thu, 18 Dec 2025 00:28:21 +0100 Subject: [PATCH] Revert "Fix: Footnotes - validate data integrity before render" This reverts commit ad7e9bd26714b6b2839513047a9479a60d33b874. --- src/activities/reader/EpubReaderActivity.cpp | 42 +------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index 691ccd7..a00429a 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -324,46 +324,6 @@ void EpubReaderActivity::renderScreen() { Serial.printf("[%lu] [ERS] Page loaded: %d elements, %d footnotes\n", millis(), p->elementCount, p->footnoteCount); - // Check footnote before copy - bool hasCorruptedFootnotes = false; - for (int i = 0; i < p->footnoteCount && i < 8; i++) { // Changé de 16 à 8 - FootnoteEntry* fn = p->getFootnote(i); - if (fn) { - bool numberValid = false; - bool hrefValid = false; - - // Search null terminator in number (3 bytes) - for (int j = 0; j < 3; j++) { - if (fn->number[j] == '\0') { - numberValid = true; - break; - } - } - - // Search null terminator in href (64 bytes) - for (int j = 0; j < 64; j++) { - if (fn->href[j] == '\0') { - hrefValid = true; - break; - } - } - - if (!numberValid || !hrefValid) { - Serial.printf("[%lu] [ERS] CORRUPTION DETECTED in footnote %d: number=%d, href=%d\n", - millis(), i, numberValid, hrefValid); - hasCorruptedFootnotes = true; - break; - } - } - } - - if (hasCorruptedFootnotes) { - Serial.printf("[%lu] [ERS] Page has corrupted footnotes - clearing cache\n", millis()); - section->clearCache(); - section.reset(); - return renderScreen(); - } - // Copy footnotes from page to currentPageFootnotes currentPageFootnotes.clear(); int maxFootnotes = (p->footnoteCount < 8) ? p->footnoteCount : 8; @@ -374,7 +334,7 @@ void EpubReaderActivity::renderScreen() { currentPageFootnotes.addFootnote(footnote->number, footnote->href); } } - Serial.printf("[%lu] [ERS] Loaded %d footnotes for current page\n", millis(), maxFootnotes); + Serial.printf("[%lu] [ERS] Loaded %d footnotes for current page\n", millis(), p->footnoteCount); const auto start = millis(); renderContents(std::move(p));