You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No segmentation fault should be raised. The file name would be left empty in the output.
Suggested Fix:
The segmentation fault is caused by strlen(nullptr), so maybe we should check if input_file_ is nullptr before doing AppendString (here)? It could also be fixed if the API user calls TessBaseAPISetInputName every time before TessResultRendererBeginDocument, but I still think this should be counted as a bug.
BTW, it worked for tesseract v4. #2700 is where a related breaking change was introduced.
The text was updated successfully, but these errors were encountered:
Oh, actually an empty input_file_ would also cause a segmentation fault, because api->GetInputName() returns nullptr for it. It can be easily fixed by checking input for AppendString.
Environment
5.1.0
tag 5.1.0
Linux 5.16.18-200.fc35.x86_64 #1 SMP PREEMPT Mon Mar 28 14:10:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Current Behavior:
There would raise a segmentation fault if I use the following APIs (in pseudo code):
Expected Behavior:
No segmentation fault should be raised. The file name would be left empty in the output.
Suggested Fix:
The segmentation fault is caused by
strlen(nullptr)
, so maybe we should check ifinput_file_
isnullptr
before doingAppendString
(here)? It could also be fixed if the API user callsTessBaseAPISetInputName
every time beforeTessResultRendererBeginDocument
, but I still think this should be counted as a bug.BTW, it worked for tesseract v4. #2700 is where a related breaking change was introduced.
The text was updated successfully, but these errors were encountered: