Commit 2c2e477c authored by berak's avatar berak

text: don't delete null pointer in ocr_tesseract.cpp

parent d8673bd7
...@@ -200,6 +200,7 @@ public: ...@@ -200,6 +200,7 @@ public:
char *outText; char *outText;
outText = tess.GetUTF8Text(); outText = tess.GetUTF8Text();
output = string(outText); output = string(outText);
if (outText != NULL)
delete [] outText; delete [] outText;
if ( (component_rects != NULL) || (component_texts != NULL) || (component_confidences != NULL) ) if ( (component_rects != NULL) || (component_texts != NULL) || (component_confidences != NULL) )
...@@ -227,9 +228,9 @@ public: ...@@ -227,9 +228,9 @@ public:
delete[] word; delete[] word;
} while (ri->Next(level)); } while (ri->Next(level));
}
delete ri; delete ri;
} }
}
tess.Clear(); tess.Clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment