Skip to content

Commit

Permalink
Null check for GetSourceYResolution (#3457)
Browse files Browse the repository at this point in the history
* Null check for GetSourceYResolution

Added missing NULL check to avoid crash when we read property in our tesseract wrapper.

* Added missing return value.

added -1 to return if undefined.
  • Loading branch information
MonkeybreadSoftware committed Jun 16, 2021
1 parent 7a308ed commit 75e6c3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,8 @@ const char *TessBaseAPI::GetDatapath() {
}

int TessBaseAPI::GetSourceYResolution() {
if (thresholder_ == nullptr)
return -1;
return thresholder_->GetSourceYResolution();
}

Expand Down

0 comments on commit 75e6c3e

Please sign in to comment.