Menu

#19 'read magic2' & crash when using db

open
nobody
5
2007-05-19
2007-05-19
Anonymous
No

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!

Discussion


Log in to post a comment.

MongoDB Logo MongoDB