diff --git a/modules/imgproc/HGOCRHanvon.cpp b/modules/imgproc/HGOCRHanvon.cpp index fad6c1cd..32afe77a 100644 --- a/modules/imgproc/HGOCRHanvon.cpp +++ b/modules/imgproc/HGOCRHanvon.cpp @@ -109,14 +109,12 @@ HGResult HGOCRHanvon::ImageOCR(HGImage image, class HGOCRRetImpl **ocrRet) int len = 0; int rc = HWOCR_RecognizeFile2Str((unsigned char*)tmpFileName, m_ocrHandle, &rst, &len); HGBase_DeleteFile(tmpFileName); - if (0 != rc) + if (0 != rc || NULL == rst) { HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "HGOCRHanvon::ImageOCR: HWOCR_RecognizeFile2Str fail in=%s", tmpFileName); return HGIMGPROC_ERR_OCR; } - assert(NULL != rst && len > 0); - std::vector blockInfo; blockInfo.push_back(rst); HWOCR_FreeStrRst(&rst);