mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 12:16:54 +08:00
Fixed a segfault on array that was too small when setting Tesseract base dir
This commit is contained in:
@@ -31,7 +31,7 @@ OCR::OCR(Config* config)
|
||||
tesseract=new TessBaseAPI();
|
||||
|
||||
// Tesseract requires the prefix directory to be set as an env variable
|
||||
vector<char> tessdataPrefix(config->getTessdataPrefix().size());
|
||||
vector<char> tessdataPrefix(config->getTessdataPrefix().size() + 1);
|
||||
|
||||
strcpy(tessdataPrefix.data(), config->getTessdataPrefix().c_str());
|
||||
putenv(tessdataPrefix.data());
|
||||
|
Reference in New Issue
Block a user