mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-07 09:52:40 +08:00
Fix segfault at ComputeNormMatch/normmatch.cpp:118 (issue 755)
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@839 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
16aa99315a
commit
80040b834b
@ -58,7 +58,7 @@ void Classify::ClearCharNormArray(uinT8* char_norm_array) {
|
||||
* into char_norm_array. CharNormArray is indexed by unichar_id.
|
||||
*
|
||||
* Globals:
|
||||
* - none
|
||||
* - PreTrainedTemplates current set of built-in templates
|
||||
*
|
||||
* @param norm_feature character normalization feature
|
||||
* @param[out] char_norm_array place to put results of size unicharset.size()
|
||||
|
@ -94,6 +94,10 @@ FLOAT32 Classify::ComputeNormMatch(CLASS_ID ClassId,
|
||||
PROTOTYPE *Proto;
|
||||
int ProtoId;
|
||||
|
||||
if(ClassId > NormProtos->NumProtos) {
|
||||
ClassId = NO_CLASS;
|
||||
}
|
||||
|
||||
/* handle requests for classification as noise */
|
||||
if (ClassId == NO_CLASS) {
|
||||
/* kludge - clean up constants and make into control knobs later */
|
||||
|
Loading…
Reference in New Issue
Block a user