Update ocr.h

Fix minimum image size validation in ocr_extract_text
This commit is contained in:
simon987 2022-01-08 10:24:57 -05:00 committed by GitHub
parent 94a5e0ac59
commit cd2a44e016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ ocr_extract_text(const char *tesseract_path, const char *tesseract_lang,
const int img_bpp, const int img_stride, const int img_xres,
const ocr_extract_callback_t cb) {
if (img_h <= MIN_OCR_SIZE || img_h <= MIN_OCR_SIZE || img_xres <= 0 ||
if (img_w <= MIN_OCR_SIZE || img_h <= MIN_OCR_SIZE || img_xres <= 0 ||
!OCR_IS_VALID_BPP(img_bpp)) {
return;
}