Null check for GetSourceYResolution (#3457)

* 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.
This commit is contained in:
MonkeybreadSoftware 2021-06-16 15:35:24 +02:00 committed by GitHub
parent 7a308edcb1
commit 75e6c3ea4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -955,6 +955,8 @@ const char *TessBaseAPI::GetDatapath() {
}
int TessBaseAPI::GetSourceYResolution() {
if (thresholder_ == nullptr)
return -1;
return thresholder_->GetSourceYResolution();
}