'read magic2' & crash when using db
Status: Alpha
Brought to you by:
joerg10
I'm running with:
gocr044 -m 130 myfile.pbm
I get the above error in readpgm(), called from load_db(), followed by a crash.
It seems that the static var f1 in readpgm() has got a stale pointer left over in it. Changing the code in readpgm() that reads:
if(name[0]=='-' && name[1]==0){
f1=NULL;
} else {
if(!pip)
fclose(f1);
to:
if(name[0]=='-' && name[1]==0){
f1=NULL;
} else {
if(!pip) {
fclose(f1);
f1=NULL;
}
fixed the problem for me.
Neat project, by the way!