mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-28 05:39:35 +08:00
Fix crash if output file could not be opened
This error case results in fout_ == nullptr. Closing a nullptr file is not allowed. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
6bebe71749
commit
84396707a8
@ -47,10 +47,12 @@ TessResultRenderer::TessResultRenderer(const char *outputbase,
|
||||
}
|
||||
|
||||
TessResultRenderer::~TessResultRenderer() {
|
||||
if (fout_ != stdout)
|
||||
fclose(fout_);
|
||||
else
|
||||
clearerr(fout_);
|
||||
if (fout_ != nullptr) {
|
||||
if (fout_ != stdout)
|
||||
fclose(fout_);
|
||||
else
|
||||
clearerr(fout_);
|
||||
}
|
||||
delete next_;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user