mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 15:06:50 +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=new TessBaseAPI();
|
||||||
|
|
||||||
// Tesseract requires the prefix directory to be set as an env variable
|
// 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());
|
strcpy(tessdataPrefix.data(), config->getTessdataPrefix().c_str());
|
||||||
putenv(tessdataPrefix.data());
|
putenv(tessdataPrefix.data());
|
||||||
|
Reference in New Issue
Block a user