Merge pull request #32 from orbitcowboy/master

Fix potential null pointer dereference in ccmain/paragraphs.cpp.
This commit is contained in:
zdenop 2015-05-20 19:01:13 +02:00
commit f8ebff262e

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);