Review comments

This commit is contained in:
jpirnay
2026-05-07 22:20:10 +02:00
parent 3ecbf29bd4
commit 3316d33a4e
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -160,6 +160,10 @@ std::unique_ptr<PageTableFragment> PageTableFragment::deserialize(FsFile& file)
serialization::readPod(file, cell.isHeader);
uint8_t lineCount;
serialization::readPod(file, lineCount);
if (lineCount > MAX_CELL_LINES) {
LOG_ERR("PGE", "TableFragment: invalid lineCount %u at row %u cell %u", lineCount, r, c);
return nullptr;
}
cell.lines.reserve(lineCount);
for (uint8_t l = 0; l < lineCount; l++) {
auto tb = TextBlock::deserialize(file);
@@ -1315,6 +1315,7 @@ void XMLCALL ChapterHtmlSlimParser::endElement(void* userData, const XML_Char* n
if (self->currentTable && self->currentTable->depth > 1 && strcmp(name, "table") == 0) {
self->partWordBufferIndex = 0;
self->currentTable->depth -= 1;
self->depth -= 1;
LOG_DBG("EHP", "nested table end, depth now %d", self->currentTable->depth);
return;
}