From cd2a44e016247f3bb219ea303e3192de0ba39c8d Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 8 Jan 2022 10:24:57 -0500 Subject: [PATCH] Update ocr.h Fix minimum image size validation in ocr_extract_text --- third-party/libscan/libscan/ocr/ocr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/libscan/libscan/ocr/ocr.h b/third-party/libscan/libscan/ocr/ocr.h index caf5972..e4f158d 100644 --- a/third-party/libscan/libscan/ocr/ocr.h +++ b/third-party/libscan/libscan/ocr/ocr.h @@ -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; }