Fix potential null pointer dereference in ccmain/paragraphs.cpp.

This commit is contained in:
orbitcowboy 2015-05-19 10:17:44 +02:00
parent 05acff6253
commit 9328f0e5d4

View File

@ -636,7 +636,11 @@ bool TessPDFRenderer::BeginDocumentHandler() {
" /Length1 %ld\n"
">>\n"
"stream\n", size, size);
if (n >= sizeof(buf)) return false;
if (n >= sizeof(buf))
{
delete[] buffer;
return false;
}
AppendString(buf);
objsize = strlen(buf);
AppendData(buffer, size);