mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-18 11:28:51 +08:00
Fix function Classify::WriteIntTemplates (issue #3925)
It crashed when running mftraining because unicharset_size in file "inttemp" was written with 8 bytes instead of 4 bytes. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
4fa046b1b3
commit
23138ab88a
@ -919,13 +919,13 @@ void ClearFeatureSpaceWindow(NORM_METHOD norm_method, ScrollView *window) {
|
||||
void Classify::WriteIntTemplates(FILE *File, INT_TEMPLATES_STRUCT *Templates,
|
||||
const UNICHARSET &target_unicharset) {
|
||||
INT_CLASS_STRUCT *Class;
|
||||
auto unicharset_size = target_unicharset.size();
|
||||
uint32_t unicharset_size = target_unicharset.size();
|
||||
int version_id = -5; // When negated by the reader -1 becomes +1 etc.
|
||||
|
||||
if (Templates->NumClasses != unicharset_size) {
|
||||
tprintf(
|
||||
"Warning: executing WriteIntTemplates() with %d classes in"
|
||||
" Templates, while target_unicharset size is %zu\n",
|
||||
" Templates, while target_unicharset size is %" PRIu32 "\n",
|
||||
Templates->NumClasses, unicharset_size);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user