mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-18 19:39:24 +08:00
Fix potential null pointer dereference in ccmain/paragraphs.cpp.
This commit is contained in:
parent
05acff6253
commit
d8a55d739d
@ -636,7 +636,11 @@ bool TessPDFRenderer::BeginDocumentHandler() {
|
|||||||
" /Length1 %ld\n"
|
" /Length1 %ld\n"
|
||||||
">>\n"
|
">>\n"
|
||||||
"stream\n", size, size);
|
"stream\n", size, size);
|
||||||
if (n >= sizeof(buf)) return false;
|
if (n >= sizeof(buf))
|
||||||
|
{
|
||||||
|
delete[] buffer;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
AppendString(buf);
|
AppendString(buf);
|
||||||
objsize = strlen(buf);
|
objsize = strlen(buf);
|
||||||
AppendData(buffer, size);
|
AppendData(buffer, size);
|
||||||
|
@ -2400,8 +2400,11 @@ void InitializeTextAndBoxesPreRecognition(const MutableIterator &it,
|
|||||||
}
|
}
|
||||||
word_res = page_res_it.forward();
|
word_res = page_res_it.forward();
|
||||||
} while (page_res_it.row() == this_row);
|
} while (page_res_it.row() == this_row);
|
||||||
info->lword_box = lword->word->bounding_box();
|
|
||||||
info->rword_box = rword->word->bounding_box();
|
if(lword)
|
||||||
|
info->lword_box = lword->word->bounding_box();
|
||||||
|
if(rword)
|
||||||
|
info->rword_box = rword->word->bounding_box();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user